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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Getting the proportion of a subcategory inside the larger category

Hello,

 

I've been working on this problem for a week I'm fairly new to DAX so I figure that ther is problem a really simple solution that I am just not thinking of.

 

At my job we have often have to rework parts to make them usable because of this we have several different cateogries of rework. I want to calculate the proportion of rework types that we have each part as a stacked bar chart. I tried using using Divide([Count of Rework categories], [Count of part number]) which gives me the correct answe but once I start to slice the data it no longer gives me the values out of 100%. How can I set it up so that the data filters in correctly for the the problem I'm working on. 

 

If that what I'm asking is confusing here is an example of some fake data that and  the outputs that I am looking for.

 

slxa_0-1601221018311.pngslxa_1-1601221051313.png

 

 

Thank you all for your help

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try new measures like


divide(count(Table[Reworkcategory]), calculate(count(Table[Reworkcategory]),allexcept(Table,Table[Part])))

or

divide(count(Table[Reworkcategory]), calculate(count(Table[Reworkcategory]),Filter(allselected(Table),Table[Part] =max(Table[Part]))))

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try new measures like


divide(count(Table[Reworkcategory]), calculate(count(Table[Reworkcategory]),allexcept(Table,Table[Part])))

or

divide(count(Table[Reworkcategory]), calculate(count(Table[Reworkcategory]),Filter(allselected(Table),Table[Part] =max(Table[Part]))))

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
Anonymous
Not applicable

@amitchandak 

 

Thank you so much for your help!

I was grinding away at that forever.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.