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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.