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

Join 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.

Reply
ilhamfadhillah4
New Member

Percentage by Multiple Category

HI all, so I've been having this problem of calculating percentages by multiple categories. Here's a sample dataset:

IDStatusMonthCategory
ID1CompleteJanA
ID2IncompleteFebB
ID3CompleteMarA
ID4IncompleteMarC
ID5CompleteFebB
ID6IncompleteJan

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:

 

ilhamfadhillah4_0-1681266658140.png

 

 Consider that each color is the category. Any inputs will be welcome, thanks in advance!

5 REPLIES 5
Jihwan_Kim
Super User
Super User

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.

 

Jihwan_Kim_0-1681269758485.png

 

Jihwan_Kim_1-1681270044871.png

 

Expected result measure: =
VAR _count =
    COUNTROWS ( Data )
VAR _completecount =
    CALCULATE ( COUNTROWS ( Data ), Data[Status] = "Complete" )
RETURN
    DIVIDE ( _completecount, _count )

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Edit: It works! Thank you!

 

Hi Jihwan,

Tried your solution, but somehow it returns like this

ilhamfadhillah4_0-1681276094472.png

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 )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
FreemanZ
Super User
Super User

hi @ilhamfadhillah4 

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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