Count lapsed customers with FILTER and ISBLANK
Find customers who bought in the same period last year but not this one, by testing two measures for blanks on every Customer row.
You will learn to
- Test a measure for each row of a dimension with FILTER
- Use ISBLANK to find customers with no sales
- Combine two conditions with &&
How it works
A customer who bought nothing has **no rows** in Sales for the period. Nothing in the fact table points at them, so you can’t find them by scanning Sales. You have to start from the dimension: iterate `Customer` and ask a question about each one.
`FILTER(Customer, condition)` does that. When the condition uses a **measure**, the measure is calculated for that one customer (a measure reference always does context transition), under the report’s other filters too.
A customer with no sales gets a **blank**, not zero, and `ISBLANK(...)` tests for it. Put `NOT` in front to mean “has sales”, and join two tests with `&&` (both must be true).
Practice it hands-on with a real data model and a live report that updates as you type.
Customers Without Bikes = COUNTROWS(FILTER(Customer, ISBLANK(CALCULATE([Total Sales], Product[Category] = "Bikes"))))