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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
josephliverpool
Frequent Visitor

Percentage Measure (I'm embarrassed to even be asking this)

I have a table in Power BI titles 'Case Details' which has a column called 'Case Type'.

 

I want to write a measure which will calculate the percentage for each case type which makes up the total number of rows.

 

I appreciate that this is really simple yet I can't get it to work!!!

1 ACCEPTED SOLUTION
dk_dk
Super User
Super User

Hi @josephliverpool 

The easiest way to do this is:

dk_dk_1-1726218012954.png


Add a column from your table to the visual and select Count aggregation. Then Show value as % of grand total.

 

Alternatively you can set up a measure that looks like this:


Measure =


VAR casetype = MAX('Case Details'[Case Type)

VAR totCount = COUNTROWS(ALL('Case Details'))
VAR typeCount = CALCULATE(COUNTROWS('Case Details'),'Case Details'[Case Type] = casetype)

RETURN
typeCount/totCount



format as % and it should work


Hope this helps!




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

Proud to be a Super User!





View solution in original post

3 REPLIES 3
anmolmalviya05
Super User
Super User

Hi @josephliverpool, Hope you are doing good !

please try the below measure:

Case Type Percentage =
DIVIDE(
COUNTROWS('Case Details'),
CALCULATE(COUNTROWS('Case Details'), ALL('Case Details'))
)

dk_dk
Super User
Super User

Hi @josephliverpool 

The easiest way to do this is:

dk_dk_1-1726218012954.png


Add a column from your table to the visual and select Count aggregation. Then Show value as % of grand total.

 

Alternatively you can set up a measure that looks like this:


Measure =


VAR casetype = MAX('Case Details'[Case Type)

VAR totCount = COUNTROWS(ALL('Case Details'))
VAR typeCount = CALCULATE(COUNTROWS('Case Details'),'Case Details'[Case Type] = casetype)

RETURN
typeCount/totCount



format as % and it should work


Hope this helps!




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

Proud to be a Super User!





Selva-Salimi
Super User
Super User

Hi @josephliverpool 

 

you can write a measure as follows:

 

percentage:= sum( your_value) / calculate(sum(your_value) , all(your_table))

 

If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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