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
DP3567
New Member

How can I divide my column AFTER filter? Trying to calculate a percentage difference

Hi All,

 

I work at a university and I'm still learning how to get the best of Power BI and am trying to replicate an excel report in Power BI, as a long term replacement.

 

One element I'm not able to replicate is 'percentage of cohort' which is essentially the (distinct) number of students participating in events divided by the total number of students and then converted to a percentage. 

 

In Power BI these two fields sit on two different tables. 

 

I've attempted to create a quick measure to make the same division sum with said fields - which works prior to using a slicer to filter. 

 

When I attempt to use the slicer to filter by department (school), the measure filters the (distinct) number of students participating in events (top figure) but then gets divided by an unaffected TOTAL. This is causing the rows within my table visual to show a much smaller percentage as it shows the percentage of the total cohort and not the cohort filtered to that department (school).

 

Is there any way I can have a table with a column for percentage of cohort that filters BOTH the participants at events AND the cohort itself?

 

Thanks so much for your help!

 

Dave

4 REPLIES 4
DP3567
New Member

Thanks so much for the quick response @Greg_Deckler.

 

It's 

Count of Student Number divided by Count of Student Number =
DIVIDE(
    DISTINCTCOUNT('App, Cen Events, Curriculum'[Student Number]),
    COUNTA('Student Details'[Student Number])
)

 

@DP3567 Try one of these:

Count of Student Number divided by Count of Student Number =
DIVIDE(
    DISTINCTCOUNT('App, Cen Events, Curriculum'[Student Number]),
    COUNTAX(ALLSELECTED('Student Details'), [Student Number])
)

or

Count of Student Number divided by Count of Student Number =
DIVIDE(
    DISTINCTCOUNT('App, Cen Events, Curriculum'[Student Number]),
    COUNTAX(ALL('Student Details'), [Student Number])
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler but unfortunatley I'm getting lower percentages than before so not getting expected results.

 

To give an example: We have a business school with 726 unique participants from events and 1378 students in that school. I'm expecting to see around 53% of cohort (726 / 1378 * 100).

 

With your suggested solution I get 11% for that school for some reason. In my original calculation I get 14% (which seems to be 726 / Total of all students (16147)

 

Thanks for your your assistance!

Greg_Deckler
Community Champion
Community Champion

@DP3567 What is the formula for your measure?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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