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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Stuznet
Helper V
Helper V

How to Calculate Subtotal in a Rows

Hi Power Bi Community,

 

I'm struggling calculating the Subtotal in a rows. This problem is similar to this I have week ago. Thanks to @Greg_Deckler

https://community.powerbi.com/t5/Desktop/How-to-Calculate-Total-Column-When-is-Not-Displaying-the-To...

 

When I went to the paint roller and turned on the Subtotal, somehow it doesn't show me the subtotal in a row instead it displayed the Total per column and is wrong too.

 2018-10-02_12-54-15.png

 

I want the Total amount in a row. How can I write a formula or do I need to create a new measure?

2018-10-02_12-57-23.png

 

Col1 = SWITCH(TRUE(),
    
MAX('Table2'[Category]) = "A",
    CALCULATE(COUNT(Table1[Percent]),FILTER(Table1,[Buck]= "25%")),
    
MAX('Table2'[Category]) = "E",
CALCULATE(SUM(Table1[ABC]),
    FILTER(Table1,Table1[Buck] = "25%"),FILTER(Table1,Table1[Rank] = "Yes")),
    
MAX('Table2'[Category]) = "D",
CALCULATE(SUM(Table1[ABC]),
    FILTER(Table1,Table1[Buck] = "25%"), FILTER(Table1,Table1[Rank] <> "Yes")),
    
MAX('Table2'[Category]) = "C",
FORMAT(DIVIDE([INF],[TotalSumABC]),"0.0%"),

MAX('Table2'[Category]) = "B",
CALCULATE(SUM(Table1[Amt]),FILTER(Table1,SEARCH("25%)",[Buck],1,0))),

MAX('Table2'[Category]) = "F",
CALCULATE([INF] - [Value]),

MAX('Table2'[Category]) = "G",
FORMAT(DIVIDE([VAR],[Value]),"0.0%"))

 

 

1 ACCEPTED SOLUTION

Presuming you are using a matrix visual, you will need to create a 3rd measure that is the sum of Col1 and Col2

 

TotalCol = [Col1] + [Col2]

Then put TotalCol in your visual next to Col1 and Col2

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If, instead, Col1 and Col2 are values from the data (for example year, location, etc), you can put that field in the "Columns" of the matrix and you will get the option to turn column values on or off.

 

Hope this helps

David

 

 

View solution in original post

4 REPLIES 4
dedelman_clng
Community Champion
Community Champion

You can create a measure that adds Col1 and Col2.  The only way to have the visual provide column subtotals is to have columns defined for the matrix (as opposed to just multiple measures as in your case).

 

Hope this helps

David

@dedelman_clngI'm not certain what did you meant by that. Could you show me? 

Presuming you are using a matrix visual, you will need to create a 3rd measure that is the sum of Col1 and Col2

 

TotalCol = [Col1] + [Col2]

Then put TotalCol in your visual next to Col1 and Col2

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If, instead, Col1 and Col2 are values from the data (for example year, location, etc), you can put that field in the "Columns" of the matrix and you will get the option to turn column values on or off.

 

Hope this helps

David

 

 

Thank you 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors