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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sraj
Responsive Resident
Responsive Resident

matrix subtotal

Hi there,

 

Can someone please advise on how I can handle this?


The highlighted column is a calcualted field (1575-5-1535 =35) in matrix, which I want it to show the subtotal of 73, but it is showing the row calculation.  1575-7-1535 = 33.
sraj_0-1726685706167.png


Calculated field
Remaining  Scheduled =
MAX('uv_pbi_res_id_count'[res_val_protests]) - SUM('uv_pbi_hrsummary'[count_strap])- MAXA('uv_pbi_res_agent_id_count'[res_settled])

I hope it makes sense, please help.

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from parry2k  please allow me to provide another insight:

Hi, @sraj 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1727104749959.png

vlinyulumsft_1-1727104749960.png

2.First create a calculation table: 

Table2 =
VAR _summarize =
    SUMMARIZE (
        'Table',
        [id],
        "Column1", "RETURN",
        "VALUE",
            CALCULATE (
                SUM ( 'Table'[VALUE] ),
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] = "B" )
            )
                - CALCULATE (
                    SUM ( 'Table'[VALUE] ),
                    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] = "C" )
                )
                - CALCULATE (
                    SUM ( 'Table'[VALUE] ),
                    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] = "D" )
                )
    )
RETURN
    UNION ( 'Table', _summarize )

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1727104800636.png

4.Here is the relevant documentation:

How to put the row and column subtotals in front o... - Microsoft Fabric Community

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from parry2k  please allow me to provide another insight:

Hi, @sraj 

Regarding the issue you raised, my solution is as follows:

1.First I have created the following table and the column names and data are the data you have given:

vlinyulumsft_0-1727104749959.png

vlinyulumsft_1-1727104749960.png

2.First create a calculation table: 

Table2 =
VAR _summarize =
    SUMMARIZE (
        'Table',
        [id],
        "Column1", "RETURN",
        "VALUE",
            CALCULATE (
                SUM ( 'Table'[VALUE] ),
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] = "B" )
            )
                - CALCULATE (
                    SUM ( 'Table'[VALUE] ),
                    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] = "C" )
                )
                - CALCULATE (
                    SUM ( 'Table'[VALUE] ),
                    FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Column1] = "D" )
                )
    )
RETURN
    UNION ( 'Table', _summarize )

3.Here's my final result, which I hope meets your requirements.

vlinyulumsft_2-1727104800636.png

4.Here is the relevant documentation:

How to put the row and column subtotals in front o... - Microsoft Fabric Community

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

parry2k
Super User
Super User

@sraj I will defer your question to @Greg_Deckler - good luck!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.