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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
degausser86
Regular Visitor

Newbie Problem with showing value as a percentage of row GRAND total

Hi Gang,

 

New member here.

 

Classroom teacher who would like some assitance from you experts out there! I'm sure it's a relatively easy fix, when you know how!

 

I've come to a point where I dont think Excel can solve what i want in pivot tables, but basically I have joined several excel files with power query and want to display some school wide data from multiple departments.

 

Basically, I want to see what percentage of students experiencing financial hardship (Y in this table below) fit into each ethnicity. I want to see the number of students as a percentage of all students that experience hardship (i.e all the Y's in the table that are unique, otherwise i'll count the same student more than one time for each subject they are enrolled on) It's almost as if i want to work it out as a percentage of a row as a GRAND total if they are Y?

 

For example, if there were 10 total students with a Y and 5 of them happened to appear in the white british, then i want the percentage column to read 50%, rather than taking the value as a a percentage of the Y's in that category only as this does as 100%.

 

 

I can't think how I can do this?! Is it a measure? some sort of FILTER, but I can't work it out as I dont want to do multiple measures for other columns in this table?

 

Apologies that this post is probably not in the most accurate lingo, I'm teaching myself this!

 

degausser86_0-1681493186289.png

 

Please help!

1 ACCEPTED SOLUTION

With the help of CHAT GPT, I worked out that the code should be this.

% MIX of grand Total = DIVIDE(
        DISTINCTCOUNT('1st year polar'[ULN]),
    CALCULATE(
        DISTINCTCOUNT('1st year polar'[ULN]),
        ALLSELECTED('1st year polar')
    )
)

 

View solution in original post

3 REPLIES 3
degausser86
Regular Visitor

@amitchandak Thanks for the quick response. Would I then have to do another one for the N in hardship. Would it display in the end column or would there be 2 columns?

 

EDIT: I've also had a chance to run the measure and it doesnt seem to work precisely. I cant put my finger on it.

 

degausser86_0-1681549009559.png

Where there are 178 students selected in total, the 135 in one category should be calculating as 75.8%, but its coming out with the measure as 74?

 

Any thoughts?

With the help of CHAT GPT, I worked out that the code should be this.

% MIX of grand Total = DIVIDE(
        DISTINCTCOUNT('1st year polar'[ULN]),
    CALCULATE(
        DISTINCTCOUNT('1st year polar'[ULN]),
        ALLSELECTED('1st year polar')
    )
)

 

amitchandak
Super User
Super User

@degausser86 , a measure like

divide(countrows(filter(Table, table[hardship] ="Y")), countrows(filter(allselected(Table), table[hardship] ="Y")))

 

 

or

 

divide(calculate([Meausre], filter(Table, table[hardship] ="Y")), calculate([Meausre],filter(allselected(Table), table[hardship] ="Y")))

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