Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
HI all, so I've been having this problem of calculating percentages by multiple categories. Here's a sample dataset:
ID | Status | Month | Category |
ID1 | Complete | Jan | A |
ID2 | Incomplete | Feb | B |
ID3 | Complete | Mar | A |
ID4 | Incomplete | Mar | C |
ID5 | Complete | Feb | B |
ID6 | Incomplete | Jan | C |
So the ideal result would be to have a monthly percentage of IDs in a category that is complete compared to incomplete. For example if in January there are a total of 10 ID in category A, 8 of which are complete and 2 are incomplete. This would return a percentage of 8/10 or 80%. The visualization I want to show is a clustered chart showing the percentage for each category in each month, kinda like this:
Consider that each color is the category. Any inputs will be welcome, thanks in advance!
Hi,
I am not sure if I undersood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Expected result measure: =
VAR _count =
COUNTROWS ( Data )
VAR _completecount =
CALCULATE ( COUNTROWS ( Data ), Data[Status] = "Complete" )
RETURN
DIVIDE ( _completecount, _count )
Edit: It works! Thank you!
Hi Jihwan,
Tried your solution, but somehow it returns like this
Seems like it returns a 100%. Do you know where it might went wrong? I followed your formula exactly the same.
Hi,
I do not know how your datamodel looks like, and I assume your datamodel looks different than my sample. And I guess your column [DataStatus] is sorted by another column. Try something like the below.
Expected result measure: =
VAR _count =
COUNTROWS ( Data )
VAR _completecount =
CALCULATE (
COUNTROWS ( Data ),
FILTER ( ALLSELECTED ( Data ), Data[Status] = "Complete" )
)
RETURN
DIVIDE ( _completecount, _count )
try to feed a measure like below to the value field of your cluster bar chart:
Measure =
DIVIDE(
CALCULATE(
COUNT(TableName[ID]),
TableName[Status]="Complete"
),
COUNT(TableName[ID])
)
Edit: It works! Thank you!
Hi Freeman,
Tried your solution, it also returns a 100% like my other reply to Jihwan.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |