Sales from customers who spent over $12,000 (lifetime) with FILTER

Find your VIP customers by their all-time spend, then show their sales year by year — FILTER over Customer with a CALCULATE inside.

You will learn to

  • Filter customers by a measure with FILTER(Customer, …)
  • Fix the test to lifetime spend with ALL('Date') inside it
  • Keep the outer period filter on the sales you add up

How it works

`FILTER(Customer, [Total Sales] > 12000)` keeps the customers whose sales pass the test, and CALCULATE then adds up their sales. The test is worked out **in the current filter context**, though. In a 2024 row it asks “did this customer spend over $12,000 **in 2024**?”, which is a much higher bar than spending it over two years.

To judge customers on their **lifetime** spend, change the test’s context: wrap the measure in its own CALCULATE and clear the dates with `ALL('Date')`. The outer `[Total Sales]` is untouched, so each year still shows only that year’s sales, just from the VIP customers.

Iterate `Customer`, not `ALL(Customer)`: a table you pass to CALCULATE becomes a filter, and `ALL(Customer)` would throw away the row’s Region.

Practice it hands-on with a real data model and a live report that updates as you type.

Lifetime Hit Product Sales = CALCULATE([Total Sales], FILTER(Product, CALCULATE([Total Sales], ALL('Date')) > 50000))