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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
tarunbisht20001
Frequent Visitor

Custom row level Total in Matrix

tarunbisht20001_0-1725358261454.png

The client has requested a customization for the total calculations as follows:

  1. Total 1 should be the normal sum of the values.
  2. Total 2 should be calculated as Total 1 plus the sum of the values in the second row.
  3. Total 3 should be Total 2 plus the sum of the values in the third row.
  4. This pattern should continue, with each subsequent total being the previous total plus the sum of the values in the next row.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@tarunbisht20001 , Seem like you want cumulative in subtotal , Assume the lowest level is product name and you are using a measure M1

 

Then

Switch(True() ,

isinscope(Table[Product Name]), [M1],

calculate([M1], filter(allselected(Table), Table[Level2] <= Max(Table2[Level 2])  ) )

)

 

You can consider window function for cumulative too

 

How to Switch Subtotal and Grand Total in Power BI | Power BI Tutorials| isinscope: https://youtu.be/smhIPw3OkKA

 

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @tarunbisht20001 

 

This will involve a disconnected table and a lot of DAX. I've attached a sample pbix on how to achieve this. Alternatively, if your client is willing to spend, Inforiver has a custom viz that can custom aggregations as a row or column to a matrix.  https://appsource.microsoft.com/en-us/product/power-bi-visuals/xviz.inforiver-premium?tab=overview 

danextian_0-1725359693252.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
amitchandak
Super User
Super User

@tarunbisht20001 , Seem like you want cumulative in subtotal , Assume the lowest level is product name and you are using a measure M1

 

Then

Switch(True() ,

isinscope(Table[Product Name]), [M1],

calculate([M1], filter(allselected(Table), Table[Level2] <= Max(Table2[Level 2])  ) )

)

 

You can consider window function for cumulative too

 

How to Switch Subtotal and Grand Total in Power BI | Power BI Tutorials| isinscope: https://youtu.be/smhIPw3OkKA

 

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc
https://medium.com/@amitchandak/power-bi-window-function-3d98a5b0e07f

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.