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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measures for calculating Staff Turnover are returning incorrect totals

I have been given a file of current employees that has start dates and another file of terminated employees that has term dates but no start dates. Because this is prototype to prepare us for reviewing this kind of data going forward, I inserted a dummy start dates for the terminated employees (for testing purposes). I combined the current employees and terminated employees into one file as was done in the instructional  youtube video: Calculating Staff Turnover In Power BI Using DAX - HR Insights 

I then used the DAX expressions I copied from that video.

 

However, I am not getting the correct totals and have no idea what I've done wrong or how to fix it.

 

See details below:

***The following measure returns a total of 2,613 for current staff (ironically this is the total of the terms) but should be 11,080.

 

Current Staff =

CALCULATE( COUNTROWS( 'Staff Population' ),

                FILTER( VALUES('Staff Population'[Start Date]), 'Staff Population'[Start Date] <= MAX( Dates[Date] ) ),

                FILTER( Values('Staff Population'[Term Date] ), OR( 'Staff Population'[Term Date] >=MIN( Dates[Date] ), ISBLANK('Staff Population'[Term Date] ) ) ) )

 

Below image of the 'Current Staff' measure results:

CurrentStaff.PNG

***The following measure returns a total of 2 terminated employees but there should be a total of 2,613 Terminations.

Staff Turnover =

CALCULATE( COUNTROWS( 'Staff Population' ),

                FILTER( VALUES('Staff Population'[Term Date] ), 'Staff Population'[Term Date] <= MIN( Dates[Date] ) ),

                                'Staff Population'[Term Date] <> BLANK() )

 

Below image of the 'Staff Trunover' measure results:StaffTurnover.PNG

Below is the model relationship view

RelationshipModel.PNG

Below is the Data Table View

Data Table ViewData Table View

 
 

I have a pbix file I can share (it's all redacted data) but I can't upload it here.

 

Also, please let me know if you know of good (but inexpensive) Power BI desktop courses if you know of any. 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , refer to my HR blogs and the comments. There is small change required for < /= , was causing some issue

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

View solution in original post

Anonymous
Not applicable

@amitchandak, Wow! This is awesome! Thank you for pointing me to your HR blog! So helpful!!

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , refer to my HR blogs and the comments. There is small change required for < /= , was causing some issue

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Anonymous
Not applicable

@amitchandak, Wow! This is awesome! Thank you for pointing me to your HR blog! So helpful!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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