09.6The “Total” row recalculates the measure
In Excel, you are used to the “Total” row adding up the rows above it. In a Power BI visual, it does something else. Don’t worry, it is not a flaw, and you are about to see why.
09.6.1A context like any other
Each row of a visual is a separate calculation, with its own filter context. The New York row keeps only the New York sales.
The “Total” row is a separate calculation too. Its context filters no city. Power BI recalculates the measure there over all the visible sales. It does not add up the rows shown above.
Click a row of the visual, then the “Total” row, to see the sales each one keeps.
| City | Revenue |
|---|---|
| 900,000 | |
| 500,000 | |
| 300,000 | |
| 1,700,000 |
| Sale ID | Customer city | Category | Amount |
|---|---|---|---|
| V001 | New York | Sedan | 250,000 |
| V002 | New York | SUV | 150,000 |
| V003 | Chicago | Sedan | 100,000 |
| V004 | Chicago | City car | 100,000 |
| V005 | Toronto | Sedan | 150,000 |
| V006 | New York | Sedan | 200,000 |
| V007 | New York | SUV | 150,000 |
| V008 | New York | City car | 150,000 |
| V009 | Chicago | Sedan | 150,000 |
| V010 | Chicago | SUV | 150,000 |
| V011 | Toronto | SUV | 100,000 |
| V012 | Toronto | City car | 50,000 |
The “Total” row keeps the 12 sales. SUM adds them up directly, without going through the three rows.
09.6.2When the total changes everything
For a sum, both ways give the same total. For a division, like an average price, they differ. Let’s place this measure in a table by city, and look at the “Total” row:
| City | Average Price |
|---|---|
| New York | 23,077 |
| Chicago | 21,739 |
| Toronto | 23,077 |
| Total | 22,667 |
This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.
New York sells 39 cars for 900,000, Chicago 23 for 500,000, Toronto 13 for 300,000. The “Total” row divides 1,700,000 by the 75 cars, and finds 22,667.
The average of the three row prices would give 22,631. It would be wrong, because Chicago would weigh as much as New York, even though it sells fewer cars. Here, the recalculation of the “Total” row gives the right average price.
Sometimes, on the contrary, you expect the sum of the rows, and the recalculation comes as a surprise. This case has its own chapter, later, with its solutions. If the total of your own visual already surprises you, the Diagnostic guides you step by step.
Quiz
The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.
Question 1
What does Power BI do to show the “Total” row of a visual?
Question 2
A visual by category shows the measure DISTINCTCOUNT( Sales[Customer ID] ). The rows show 3 for sedans, 4 for SUVs and 3 for city cars. What does the “Total” row show?
Question 3
A visual by city shows the measure AVERAGE( Sales[Amount] ). The rows show 180,000 for New York, 125,000 for Chicago and 100,000 for Toronto. What does the “Total” row show?
- The “Total” row of a visual recalculates the measure, in a context that filters none of the row values.
- For a sum, the recalculated total equals the sum of the rows. For a division, an average or a condition, it can differ.