Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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!!!
Solved! Go to Solution.
Hi @josephliverpool
The easiest way to do this is:
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!
Proud to be a 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'))
)
Hi @josephliverpool
The easiest way to do this is:
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!
Proud to be a Super User! | |
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
130 | |
80 | |
53 | |
38 | |
35 |
User | Count |
---|---|
207 | |
82 | |
75 | |
55 | |
50 |