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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Stabben23
Helper I
Helper I

Total sum in Matrix

Hi,

 

I need help to get correct total sum in my Matrix, this should be done in DAX.

I have Pcs in carton from one table on article level, this works on all rows. I need some filter (I guess) to filter out the value 3000 in my DAX. As it is now it calculate 86900/3000=290, thats wrong., it should sum up the rows instead.

Total_cartons.PNG

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @Stabben23 

This is a measure totals problem. Very common. See this post about it
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
 
For your case, you could try this way:
measure =
VAR _table =
    SUMMARIZE (
        'Table',
        'Table'[Customer Group],
        'Table'[Articles],
        "_Cartons", [Cartons]
    )
RETURN
    SUMX ( _table, [_Cartons] )
 
Regards,
Lin
Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi @Stabben23 

This is a measure totals problem. Very common. See this post about it
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
 
For your case, you could try this way:
measure =
VAR _table =
    SUMMARIZE (
        'Table',
        'Table'[Customer Group],
        'Table'[Articles],
        "_Cartons", [Cartons]
    )
RETURN
    SUMX ( _table, [_Cartons] )
 
Regards,
Lin
Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lili6-msftthanks that you show me how to solve this kind of "measure total problem", very useful.

This is a must know for every developer, thanks again!

amitchandak
Super User
Super User

Share the formula created in dax. If possible please share a sample pbix file after removing sensitive information.
Thanks

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Can share DAX, Not pbix file.

TotalPcs =calculate(sumx(OOLINE;[OBORQT]) *1000;OCUSMA[OKCUNO] <> "2172";OOHEAD[OAORTP] <>"CRU" ;OOLINE[OBORST] <"66")
Cartons = divide([TotalPcs];sum(MIZTL2[STKRT]);0)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.