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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Katiek
Helper II
Helper II

Calculating Rate of Employee Injuries

Hi All, 

 

I've created a graph which shows the rate of employee injury per month. The rate is calculated based on the following Measure:

Rate Employee Injury = 

Calculate(([Number Employee Injuries]/130.9)*100).

In this case, in 2023 the number of Full Time Employees = 130.9.

The graph works great, except I have a slicer where I can change it to the year 2022. The rate of the graph is then incorrect because the number of Full Time Employees (FTE) in 2022 is 120.0. 

To work around this I created a table FTE with the following columns:

FTE       Year

130.9    2023

120.0    2022

 

Now I'm stuck. How do I adjust my original measure to incorporate the FTE Table so it calculates the correct FTE for the year chosen in the slicer. Help please...

 

Thanks in advance

KatieK

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Katiek 

I'll start by showing you the test data and slicer styles I use:

The test data sheet name is FTE:

vjunyantmsft_1-1699420743017.pngvjunyantmsft_2-1699420747711.png

You can use the following DAX to create a measure:

Injury Percentage = 
CALCULATE(
    25 / CALCULATE( SUM('FTE'[FTE]), FILTER('FTE', 'FTE'[Year] = MAX('FTE'[Year]))
    ))

I don't know what the [Number Employee Injuries] you give here is, so I'll use 25 instead:

vjunyantmsft_3-1699420802770.png

And the final output is shown in the following figure:

vjunyantmsft_4-1699420831228.pngvjunyantmsft_5-1699420836106.png

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
Katiek
Helper II
Helper II

Hi Dino, 

 

For some reason my replies aren't showing.

 

Thank you for your help. I updated the measure as following:

Rate of Employee Injury =
CALCULATE([Number of Employee Injury]/calculate(sum(FTE[FTE]), FILTER(FTE, FTE[Year]=MAX(FTE[Year])))*100). 
This works for 2023. However, again when I switch to 2022, it is calculating the following = (2/130.9)*100=1.53 instead of (2/121)*100=1.65. Does this havw something to do with the use of MAX?
 
Thanks for your help, 
 
KatieK
Anonymous
Not applicable

Hi @Katiek 

I'll start by showing you the test data and slicer styles I use:

The test data sheet name is FTE:

vjunyantmsft_1-1699420743017.pngvjunyantmsft_2-1699420747711.png

You can use the following DAX to create a measure:

Injury Percentage = 
CALCULATE(
    25 / CALCULATE( SUM('FTE'[FTE]), FILTER('FTE', 'FTE'[Year] = MAX('FTE'[Year]))
    ))

I don't know what the [Number Employee Injuries] you give here is, so I'll use 25 instead:

vjunyantmsft_3-1699420802770.png

And the final output is shown in the following figure:

vjunyantmsft_4-1699420831228.pngvjunyantmsft_5-1699420836106.png

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors