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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tim_001
Frequent Visitor

SUBTOTAL in Matrix Visual as Row

Hi, 

 

I am facing an issue calculating a subtotal column. I tried to use CALCULATE SUM with FILTER but it does not really work. 


Maybe somebody has a good idea? 🙂

 

Current Matrix Visual View: 

 202420252026
Apples41023
Bananas56743
Cucumber263
TOTAL118369

 

Trying to get this view with calculated row:

 202420252026
Apples41023
Bananas56743
SUBTOTAL FRUITS97766
Cucumber263
SUBTOTAL VEGETABLES263
TOTAL118369

 

Appreciate any ideas and feedback. 

 

Kind Regards

3 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@tim_001 You could get something like this if you add a column to identify Fruits and Vegetables in your table. Otherwise, you are looking at a disconnected table and a single measure that identifies the row it is in and returns the appropriate calculation.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Hi @Greg_Deckler  Thanks. So I would make another column that says if "Apple" then "Fruit" and so on. And then I can make a SUMIFS based on that column?

View solution in original post

tim_001
Frequent Visitor

Hi, I added a column and used this formula: 

If(containstring(columnname, "X"), "desired", "none")

 

Now I just moved that in the first order of the matrix visual. So I have the Subtotal as one row and you can expend from there. I think this is the easiest way thanks. 

View solution in original post

3 REPLIES 3
tim_001
Frequent Visitor

Hi, I added a column and used this formula: 

If(containstring(columnname, "X"), "desired", "none")

 

Now I just moved that in the first order of the matrix visual. So I have the Subtotal as one row and you can expend from there. I think this is the easiest way thanks. 

Greg_Deckler
Super User
Super User

@tim_001 You could get something like this if you add a column to identify Fruits and Vegetables in your table. Otherwise, you are looking at a disconnected table and a single measure that identifies the row it is in and returns the appropriate calculation.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler  Thanks. So I would make another column that says if "Apple" then "Fruit" and so on. And then I can make a SUMIFS based on that column?

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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