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
chadaden
Regular Visitor

How to find what percent multiple values are of a column

I have a table and column InjuryTracker[Mechanism of Injury]. There’s maybe 10 different values in this column with 120 rows. I want to figure out from the total entries in this column how many have the value “Slip Trip Fall”, “Struck-by”, and “Lifting”

 

Then I want to know what % those are of the total entries in the column

 

In excel I’d do a countifs but not sure with Power BI. I think I need to create a new measurement but I don’t know the formula structure for those.

Thanks!

1 ACCEPTED SOLUTION
mhossain
Solution Sage
Solution Sage

@chadaden 

Try the below measure:

DIVIDE(

CALCULATE(
Countrows(InjuryTracker),
InjuryTracker = "Slip Trip Fall" ||
InjuryTracker = "Struck-by" ||
InjuryTracker = "Lifting”
)
,
CALCULATE(
Countrows(InjuryTracker),
All(InjuryTracker[Mechanism of Injury])
)
,
0
)

 

 

 

View solution in original post

2 REPLIES 2
mhossain
Solution Sage
Solution Sage

@chadaden 

Try the below measure:

DIVIDE(

CALCULATE(
Countrows(InjuryTracker),
InjuryTracker = "Slip Trip Fall" ||
InjuryTracker = "Struck-by" ||
InjuryTracker = "Lifting”
)
,
CALCULATE(
Countrows(InjuryTracker),
All(InjuryTracker[Mechanism of Injury])
)
,
0
)

 

 

 

Awesome, thanks! I had to add the column name after the table name in the count rows function.

Test = DIVIDE(

CALCULATE(
Countrows(InjuryTracker),
InjuryTracker[Mechanism of Injury] = "Slip Trip Fall" ||
InjuryTracker[Mechanism of Injury] = "Struck-by" ||
InjuryTracker[Mechanism of Injury] = "Lifting"
)
,
CALCULATE(
Countrows(InjuryTracker),
All(InjuryTracker[Mechanism of Injury])
)
,
0
)
 

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! Prices go up Feb. 11th.

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.