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
DAX_Noob82
Regular Visitor

Calculate % and Group by Value

Hi All,

 

I have a table which contains mulitple columns. 2 of those columns are 'Pass/Fail' & 'AgeGroup' containing the following values as a sample:

PassFailAgeGroup
Fail26-34
Pass18-35
Fail26-34
Pass36-50

How do I calculate the % to 100% of each age group in a 'Clustered Column Chart'?

I tried the following but it's not giving me a total of 100%:

%PassFail = VAR PassFailTotal = COUNT(Tablename[PassFail])
                   VAR AgeGroupTotal = CALCULATE(COUNT(Tablename[PassFail]), ALLEXCEPT(Tablename,SubjectHealth[AgeGroup]))
                   RETURN
 
            DIVIDE(PassFailTotal,
                      AgeGroupTotal)
 
Instead it give me this:
DAX_Noob82_0-1667531908146.png

Thanks.

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi, 

Try something like this:

Example data:

ValtteriN_0-1667544437983.png

Dax:

Pass/ fail for group =
var _c=
CALCULATE(COUNT('Table (10)'[Pass/Fail]),ALL('Table (10)'[Pass/Fail]))

var __category = COUNT('Table (10)'[Pass/Fail])

return
DIVIDE(__category,_c)


End result:

ValtteriN_1-1667545501773.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi, 

Try something like this:

Example data:

ValtteriN_0-1667544437983.png

Dax:

Pass/ fail for group =
var _c=
CALCULATE(COUNT('Table (10)'[Pass/Fail]),ALL('Table (10)'[Pass/Fail]))

var __category = COUNT('Table (10)'[Pass/Fail])

return
DIVIDE(__category,_c)


End result:

ValtteriN_1-1667545501773.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.