Study FAQ
Why does a Power BI grand total differ from the sum of the visible rows?
Also asked as 2
- Why is a DAX measure total not always the addition of its row values?
- How should I decide whether a Power BI total must sum group results?
Answer
A DAX measure is evaluated again in the grand total's filter context. Power BI doesn't generally add the displayed measure results, so ratios, distinct counts, shared-member balances, and other non-additive calculations can legitimately have a different total.
For a margin percentage, the total usually should be total margin divided by total revenue, rather than the sum or unweighted average of row percentages. A customer threshold calculation may instead require applying the threshold separately to each customer and then combining qualifying results. State that rule before changing the DAX.
If the required total is explicitly the sum of category-level results, an iterator over the intended grouping can express it:
Sum of Category Results =
SUMX ( VALUES ( Product[Category] ), [Category Result] )
This assumes [Category Result] is an existing measure and Product[Category] is the agreed grouping. It sums categories in the current filter context, which need not be identical to every visual's displayed or truncated row set.
Compare one category, several categories, subtotals, and the grand total with a small trusted example. Don't add an iterator simply to make a non-additive metric look additive.
CALCULATE and filter context. SUMX reference. Non-additive many-to-many results.
Full explanation
DP-600: Advanced DAX Patterns for Enterprise Semantic Models
Study guide · DP-600
Read the full explanation