Why does the same DAX measure return different totals in Power BI?

Oscar
Updated 5 hours ago in

I’ve created a DAX measure to calculate the average revenue per customer across different product categories. The individual values displayed against each category appear correct, but the grand total doesn’t match the calculation I was expecting.

I understand that Power BI evaluates measures differently depending on the filter context, but I’m struggling to determine when the total should be recalculated and when it should represent an aggregation of the individual rows.

I’ve experimented with SUMX and VALUES, but I’m concerned about introducing incorrect calculations when users apply additional filters or drill down into the report.

How do you generally handle non-additive measures in Power BI while ensuring that totals remain meaningful from a business perspective?

  • 1
  • 9
  • 5 hours ago
 
5 hours ago

I’d start by putting the numerator and denominator next to the measure in the matrix. Take a return rate as an example. If Store A has 1 return out of 10 orders and Store B has 9 out of 90, both show 10%. The grand total is still 10%, because it’s calculated as 10 returns out of 100 orders. Power BI evaluates the measure again using the total’s filter context. SQLBI

The part I’d check next is what the business expects the total to mean. For a return rate, I’d keep the calculation above. For a rule like “award a bonus to each store that hits its target,” I’d evaluate the rule store by store and then add the bonuses. In DAX, that could look like SUMX(VALUES(Store[StoreID]), [Store Bonus]), assuming [Store Bonus] is the measure you want evaluated for each store. SQLBI

If you’re seeing different grand totals in two separate visuals, I’d compare their visual-level filters and slicer interactions first. The same measure can give different answers when the two visuals include different sets of orders, even on the same page.

  • Liked by
Reply
Cancel
Loading more replies