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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PBI5851
Helper V
Helper V

Assistance with Turnover rate calculation

I am working on trying to capture the turnover rate but for some odd reason, i keep getting the wrong numbers especially if i select a filter. In my measure i am using the ALL constraint, but it doesnt seem to apply for "employee count at beginning" and employee count at end". 

 

The formula i am using is

Employee who left during the period / ((employee at beginning of time period + employee at end of time period) /2)

 

Please can you advise what am i missing. 

 

Employee_CodeHireDateTermination_DateTermination_Reason
E1018/7/201911/11/2021Moved
E10210/21/20196/16/2020Better Offer
E1032/3/20204/30/2021Resigned
E1042/8/2021null 
E1053/8/20216/8/2021Moved
E1068/23/20219/30/2021Better Offer
E10710/18/202111/8/2021Resigned
E1082/28/2022null 
E1099/15/20191/1/2021consultant
E1101/1/2017null 
E11111/1/20173/24/2021resignation
E1126/29/2020null 
E1131/1/20179/22/2021Covid vaccine policy
E1148/26/2019null 
E1158/27/201212/24/2013Moved
E1168/27/20022/12/2013Better Offer
E1178/27/20121/1/2013Resigned
E1188/27/20121/31/2017 
E1198/27/20124/18/2014 
E1209/4/20122/18/2013 
E1218/27/20121/1/2013 
E1229/4/20127/5/2013 
E1239/4/20127/16/2013 

 

PBI5851_0-1653592995691.png

Employee Count at Beginning (turnover) =
CALCULATE(COUNTROWS(EmpTable),ALL(EmpTable),
FILTER(VALUES(EmpTable[HireDate]), EmpTable[HireDate] <= MIN('Date Table'[Date])),
FILTER(VALUES(EmpTable[Termination_Date]), OR (EmpTable[Termination_Date] >= min('Date Table'[Date]), ISBLANK(EmpTable[Termination_Date]))))
 
Employee Count at End (turnover) =
CALCULATE(COUNTROWS(EmpTable),ALL(EmpTable),
FILTER(VALUES(EmpTable[HireDate]), EmpTable[HireDate] <= max('Date Table'[Date]) ),
FILTER(VALUES(EmpTable[Termination_Date]), OR (EmpTable[Termination_Date] >= max('Date Table'[Date]), ISBLANK(EmpTable[Termination_Date]) ) ) )
 
Employees who left (turnover) =
CALCULATE(COUNTROWS(EmpTable),
FILTER(VALUES(EmpTable[Termination_Date]),
AND (EmpTable[Termination_Date] >= min('Date Table'[Date]), EmpTable[Termination_Date] <= max('Date Table'[Date]))))
 
Employee Turnover (Denominator) = (EmpTable[Employee Count at Beginning (turnover)] + EmpTable[Employee Count at End (turnover)]) / 2
 
Employee Annual Turnover Rate = DIVIDE(EmpTable[Employees who left (turnover)] , [Employee Turnover (Denominator)], 0)
2 REPLIES 2
PBI5851
Helper V
Helper V

@ChrisMendoza - thank you for the solution. i am trying that out, but I noticed that if i have a slicer on the termination reason, the "beginning" and "end counts" are way off, inspite of using the ALL function. Do you notice the same behavior too ? How to resolve such an issue. 

ChrisMendoza
Resident Rockstar
Resident Rockstar

@PBI5851 - I really wanted to get this working once I started tinkering with it. I took a look at Power BI: Employee turnover rate template - Finance BI (finance-bi.com) but I don't think I ended with the correct results. Here's what I managed to work through; hopefully you might get another idea on how to tackle this:

Inactive on [Termination_Date] ➡️ [Date]Inactive on [Termination_Date] ➡️ [Date]

Employee Count = 
VAR __SelectedDate = MAX('Date Table'[Date])
RETURN
    SUMX(
        EmpTable,
        VAR __startDate = [HireDate]
        VAR __termDate = EmpTable[Termination_Date]
        RETURN 
            IF(
                __startDate <= __SelectedDate &&
                OR(__termDate >= __SelectedDate, __termDate = BLANK()),
                1,
                0
            )
    )
Employee Count Running Total = 
VAR __maxDate = MAX('Date Table'[Date])
RETURN
    CALCULATE(
        [Employee Count],
        'Date Table'[Date] <= __maxDate,
        ALL('Date Table')
    )
Employees who left = 
IF(
    NOT(ISBLANK([Employee Count Running Total])),
    CALCULATE(
        [Total Count],
        USERELATIONSHIP(EmpTable[Termination_Date],'Date Table'[Date])
    )
)

 

Turnover = DIVIDE([Employees who left],(([Employees at the beginning] + [Employee Count Running Total]) / 2))

image.png

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.