VALUES as a filter: lifetime sales of this month’s customers
For each month, add up the all-time sales of the customers who bought something that month — VALUES captures who they are before ALL clears the dates.
You will learn to
- Capture the current list of values with VALUES and reuse it as a filter
- Combine it with ALL to widen the date range
- Pick the key column where the filter actually lands
How it works
`VALUES(column)` returns the values of a column that are visible right now. Hand it to CALCULATE and it becomes a filter: “keep exactly these”. CALCULATE reads its filters **before** it changes anything, so the list reflects the original row, even when another filter in the same CALCULATE clears dates.
That lets you freeze a group and then look at it differently. In the Mar 2025 row, `VALUES(Sales[CustomerKey])` is the 26 customers who bought that month. Clear the dates with `ALL('Date')` and you can add up what those same customers spent over **all** time.
Take the keys from **Sales**, where the month filter lands. The Customer table is not filtered by the month, so `VALUES(Customer[CustomerKey])` lists all 40 customers.
Practice it hands-on with a real data model and a live report that updates as you type.
All-Year Sales of These Products = CALCULATE([Total Sales], ALL('Date'), VALUES(Sales[ProductKey]))