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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors