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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Khalyda
Frequent Visitor

Percentage between two column totals in a matrix

Hello everyone,

I have a complexe matrix with a hierarchy in the matrix line and 2 columns. When I put on Column Total I get 2 Column added : Total 1 and Total 2. Till here every thing is alright. Now I want to show the percentage between my two column totals in my power BI matrix.

Lets say I have a "Total 1" and a "Total 2". How can I do to just add this percentage '%Total' at the end of my matrix ?

The result needed should be Total1/Total2 * 100

I didnt find a way to do that for two reasons : 

I didnt find how I can use the Precalculated Column Totals 

I didn't find how to add a new measure to my matrix without destroying its shape and display. Here I use only one measure in the value field of my matrix. 

Here is my actual matrix. Any help please ?

@Greg_Deckler  @V-lianl-msft @v-zhenbw-msft @v-easonf-msft @v-chuncz-msft @v-xuding-msft @v-alq-msft 

Illustration.png

 

 
3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Khalyda 

 

Based on your description, I created data to reproduce your scenario.

Table:

b1.png

 

You may create a meausre like below.

 

 

Result = 
var _name = SELECTEDVALUE('Table'[Name])
return
IF(
    NOT(ISFILTERED('Table'[Grade]))&&NOT(ISFILTERED('Table'[Class])),
    (
        ROUND(
            DIVIDE(
                CALCULATE(
                    SUM('Table'[Score]),
                    FILTER(
                        ALLSELECTED('Table'),
                        'Table'[Name] = _name&&
                        'Table'[Grade] = "g1"
                    )
                ),
                CALCULATE(
                    SUM('Table'[Score]),
                    FILTER(
                        ALLSELECTED('Table'),
                        'Table'[Name] = _name&&
                        'Table'[Grade] = "g2"
                    )
                )
            ),4
        )
        *100
    )&"%",
    SUM('Table'[Score])

)

 

 

Then you need to go to 'Visualizations' ribbon, click 'Format'=>'Subtotals', set 'Column subtotals' as on and 'Column subtotals label' as '%Total'.

b3.png

 

Result:

b2.png

 

Best Regards

Allan

 

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

 

 

 

Hi Thanks for your answer. But I think I forgot to mentione that I am using a Live connexion to a tabular model and the measure I am using now is calculated there. You think I can use your measure in SSAS ?

amitchandak
Super User
Super User

What you are looking for is the total with filter. But I do not think you can add that ratio to Matix.

I posted an idea on that: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/39773011-hybrid-table

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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