Your first measure
A measure is a formula that Power BI evaluates once for every cell of a visual. Each cell has its own filter context: the row of the matrix filters the model before the formula runs.
Here the matrix has one row per Product[Category]. The Bikes row only sees sales of bikes, so SUM adds up only their quantities. The total row sees everything.
Your task
Write a measure named Total Quantity that returns the number of units sold.
The matrix updates as you type. When it looks right, check it: every cell and every total is compared with the expected result.
About this exercise
You practise sum and the filter context of a matrix with SUM. 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, Total Quantity, fills a Power BI-style matrix grouped by Product[Category]. 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.
Last updated 10 November 2026
Solution, expected result and common mistakes
Worked solution
Total Quantity = SUM(Sales[Quantity])You wrote the formula once; the matrix ran it four times, once per category and once for the total, each in its own filter context.
The expected result
| Category | Total Quantity |
|---|---|
| Accessories | 978 |
| Bikes | 189 |
| Clothing | 264 |
| Total | 1,431 |
Common mistakes
Total Quantity = COUNTROWS(Sales)That counts order lines (COUNTROWS and COUNT both do). One line can hold several units: add up the Quantity column with SUM.
Total Quantity = SUM(Sales[Unit Price])That adds up prices. The task asks for units sold, which live in Sales[Quantity].
Hints
- Quantities live in the Sales table. Click Sales[Quantity] on the model sheet to insert it.
- The shape is SUM(Table[Column]).
Measure
| Category | Total Quantity |
|---|---|
| Accessories | 978 |
| Bikes | 189 |
| Clothing | 264 |
| Total | 1,431 |
Start typing to see your numbers.