Fix the best-customer measure
The measure below should return the sales of the best customer in each cell. Instead every cell shows its own total: the biggest “customer” is the whole cell.
Inside MAXX(Customer, …) there is a row context on Customer, but a row context doesn’t filter. A bare SUMX over Sales sees every sale of the cell. Context transition (CALCULATE, or a measure reference) turns the current customer into a filter.
Your task
Fix Best Customer Sales so that it returns the highest Sales Amount of a single customer in each cell.
About this exercise
You practise context transition, in a bug hunt with MAXX and CALCULATE. The exercise runs on a small bike-shop model with a Sales fact table and Product, Customer and Date dimensions, the same star schema in every lesson.
Your measure, Best Customer Sales, fills a Power BI-style matrix grouped by Customer[Country] and Date[Year]. As in a real report, each cell evaluates the measure in its own filter context, and the subtotals and the grand total are evaluated again in theirs rather than added up. When you check your answer, every cell is compared with the expected value, wrong cells are marked, and the hint is about the mistake you made.
Measures that already exist in the model: Sales Amount. Reference them in square brackets, for example [Sales Amount].
Where you start
Best Customer Sales = MAXX(Customer, SUMX(Sales, Sales[Quantity] * Sales[Unit Price]))The result to build
| Year | |||
|---|---|---|---|
| Country | 2024 | 2025 | Total |
| France | 28,804.85 | 20,476.05 | 49,280.90 |
| Germany | 26,623.75 | 41,608.15 | 68,231.90 |
| Netherlands | 16,970.05 | 27,943.35 | 44,913.40 |
| United Kingdom | 35,487.50 | 21,506.75 | 56,994.25 |
| Total | 35,487.50 | 41,608.15 | 68,231.90 |
Last updated 10 November 2026
Opening the exercise…