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
monika_eliza
Frequent Visitor

Matrix subtotals not working with a measure

Hello,

 

I am trying to build a matrix visualization, however the subtotals are not working properly. I created this measure:

 

Volume =

    var delta =  CALCULATE(SUM(Append1[Vol]), Append1[Customer_Name1] = "Adjustment") - CALCULATE(SUM(Append1[Vol]), Append1[Customer_Name1] <> "Adjustment")

   var volS = SUM(Append1[Vol])

    return

        IF(CONTAINS(Append1, Append1[Customer_Name1], " Adjustment"), delta, volS)

 

What I am trying to do is to create an "Adjustment" row (shown as a customer like A,B, C and Other on the screenshot) which will show the difference between "Adjustment" and the sum of the other rows. There are two cases: (1) the country has an "Adjustment" as a row - the subtotal is showing me exactly "Adjustment" value which is not correct, (2) the country do not have "Adjustment" as a row - the subtotals are working then.

 

monika_eliza_2-1673886080750.png

 

I would be very grateful for any tips on this case.

 

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@monika_eliza First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8

 

Also: Matrix Measure Total Triple Threat Rock & Roll - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler for your reply. I created the measure 

 

m_Total 1 =
VAR _table = SUMMARIZE('Append1', Append1[Customer_Name1], "_value", [Volume])
return
IF(HASONEVALUE(Append1[Customer_Name1]), [Volume], SUMX(_table, [_value]))
 
It is indeed working for totals, but the subtotals are still not right. Do you know what might be causing this problem?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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