Given a table Sales with columns Product and Quantity, what is the result of this DAX measure?
CountAllProducts = COUNTROWS(ALL(Sales[Product]))
CountAllProducts = COUNTROWS(ALL(Sales[Product]))
Think about what ALL does to the filter context on the Product column.
ALL removes any filters on the Product column, so COUNTROWS counts all unique products in the entire Sales table.
You have a measure that counts the number of customers who made purchases this month. Which visualization best shows this single number clearly on a dashboard?
Think about the simplest way to show a single number clearly.
A card visual is best for showing a single numeric value clearly without distractions.
In a star schema, you have a Customers table and a related Sales table. You want to create a measure in Customers that counts how many sales each customer made. Which DAX measure is correct?
RELATEDTABLE returns the rows in the related table for the current row in the Customers table.
RELATEDTABLE(Sales) returns all sales rows related to the current customer, so COUNTROWS counts those sales correctly.
Given this measure:
ActiveCustomers = COUNTROWS(FILTER(Customers, Customers[IsActive] = TRUE()))
It always returns zero even though some customers are active. What is the most likely cause?
Check the data type of the IsActive column and the filter condition.
If IsActive is text 'TRUE' instead of boolean TRUE, the filter condition fails and returns no rows, so COUNTROWS returns zero.
Consider this measure:
CountFiltered = COUNTROWS(FILTER(ALL(Sales), Sales[Quantity] > 10))
What does this measure return when used in a report filtered by a specific Product category?
Think about what ALL does to the filter context inside FILTER.
ALL removes filters on Sales table columns, so FILTER applies to all rows ignoring the product filter. COUNTROWS counts all rows with Quantity > 10 in the entire Sales table.