Why a filter on Sales doesn’t reach Customer: count through the fact table
Count the customers who placed a $1,000+ order line — and see why COUNTROWS(Customer) ignores a filter on the Sales table.
You will learn to
- Explain why a filter on a fact column never reaches a dimension table
- Count dimension members through the fact table
- Spot a count that silently ignores a filter
How it works
Filters flow from the **one** side of a relationship to the **many** side. So far that meant a dimension filtering the facts: pick a region, and Sales shrinks to that region’s order lines.
Now turn it around. Put a filter on a column of the **fact** table, like `Sales[Amount] >= 1000`. Sales shrinks to the big order lines, but the filter stops there. It can’t travel back up to Customer, so `COUNTROWS(Customer)` inside that CALCULATE still counts every customer the report shows — the filter is silently ignored.
The fix is to count from the side the filter **does** reach. Every order line carries its customer’s key, so the distinct keys left in `Sales[CustomerKey]` are exactly the customers who match. The same trick works for any dimension: count its key in the fact table.
Practice it hands-on with a real data model and a live report that updates as you type.
Discounted Products = CALCULATE(DISTINCTCOUNT(Sales[ProductKey]), Sales[Discount] > 0)