Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
adamw1984
Regular Visitor

Sum Measure Calculations in Matrix Totals

Hi,

I have created a measure ('Price Effect') that is the product of two other measures ('ASP Delta' and 'Qty CY'), which gives me a correct result on the lowest row level (product) of a matrix visualsation where I have customer, category and product levels included.

 

My issue is that for the customer, category and Total rows of the visualisation the same calculation is applied (ASP Delta * Qty CY), when instead I want to show the sum of the results of the product levels.

 

Below shows the results I'm getting currently.

adamw1984_1-1761919275838.png

 

The example below shows a comparison of the results I get in power BI ('Price effect' column), compared to what I want to achieve ('Correct Price Effect' column):

adamw1984_0-1761919116856.png

Is there anyway to modify the calculation so that I can show the sum of the lower level results on the total/subtotal rows instead of applying the same calculation? 
This is very easy in other tools such as Tableau where you can just select the total row calculation types within the visualization but I haven't been able to find how to do this in power BI.

 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @adamw1984 

In Power BI, the total and subtotal rows in tables or matrices don’t represent a direct sum of the rows above. Instead, they are recalculations in a different context. When Power BI reaches a total row, the DAX engine removes the filters applied at the row level and evaluates the measure again over the entire data scope.

The solution is to build a custom calculation context within the formula, for example:

SUMX(
VALUES('Product'[Product]),
[ASP Delta] * [Qty CY]
)


This forces the total to sum up the product-level results, even when the visual aggregates by category or customer.
For deeper guidance, it would help if you could share a simplified PBIX file or a sample of the data along with the expected outcome. That would make it easier to provide a precise DAX solution matching your mod.

More information about totals challnges are here:
https://www.youtube.com/watch?v=yw0QHu9V4UQ

https://www.youtube.com/watch?v=gYzszodBotc

https://www.youtube.com/watch?v=KNkLIUIb2Lo

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

2 REPLIES 2
v-pgoloju
Community Support
Community Support

Hi @adamw1984,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @Ritaf1983  for prompt and helpful response. Please try below dax to resolve the issue.


PriceEffect = SUMX(SUMMARIZE(
'Sales',
'Sales'[Customer],
'Sales'[Category],
'Sales'[Product],
"RowPriceEffect", [ASP Delta] * [Qty CY]),[RowPriceEffect])

 

Thanks & Regards,

Prasanna Kumar

Ritaf1983
Super User
Super User

Hi @adamw1984 

In Power BI, the total and subtotal rows in tables or matrices don’t represent a direct sum of the rows above. Instead, they are recalculations in a different context. When Power BI reaches a total row, the DAX engine removes the filters applied at the row level and evaluates the measure again over the entire data scope.

The solution is to build a custom calculation context within the formula, for example:

SUMX(
VALUES('Product'[Product]),
[ASP Delta] * [Qty CY]
)


This forces the total to sum up the product-level results, even when the visual aggregates by category or customer.
For deeper guidance, it would help if you could share a simplified PBIX file or a sample of the data along with the expected outcome. That would make it easier to provide a precise DAX solution matching your mod.

More information about totals challnges are here:
https://www.youtube.com/watch?v=yw0QHu9V4UQ

https://www.youtube.com/watch?v=gYzszodBotc

https://www.youtube.com/watch?v=KNkLIUIb2Lo

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors