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
dzaba
Frequent Visitor

Employee turnover monthy

Hi,

I am looking for a help with DAX to calculate the Employee turnover. 

 

My data look like that:

 

Table name: Staff Population

dzaba_0-1614893490878.png

 

To make this calculation I need 3 measuers:

1. The number of active employees at the beginning of the month 

2. The number of active employees at the end of the month 

3. The number of employees who left during that month 

 

I think that I handled with the second one (like below) but still need a help with 1 and 3.

 

End month employee =
CALCULATE( COUNTROWS( 'Staff Population' ),
FILTER( VALUES( 'Staff Population'[Start Date] ), 'Staff Population'[Start Date] <= MAX( 'Dates'[Date] ) ),
FILTER( VALUES( 'Staff Population'[End Date] ), OR( 'Staff Population'[End Date] >= MIN( 'Dates'[Date] ), ISBLANK( 'Staff Population'[End Date] ) ) ) )
1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @dzaba ,

 

You can use the following three measures:

Start month employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[Start Date]<=MIN('Date'[Date])&&OR('Staff Population'[End Date]>=MIN('Date'[Date]),ISBLANK('Staff Population'[End Date])))) 

end month employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[Start Date]<=MAX('Date'[Date])&&OR('Staff Population'[End Date]>=MAX('Date'[Date]),ISBLANK('Staff Population'[End Date])))) 


left employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[End Date] >=MIN('Date'[Date])&&'Staff Population'[End Date]<=MAX('Date'[Date])))

 

Capture.PNG

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @dzaba ,

 

You can use the following three measures:

Start month employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[Start Date]<=MIN('Date'[Date])&&OR('Staff Population'[End Date]>=MIN('Date'[Date]),ISBLANK('Staff Population'[End Date])))) 

end month employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[Start Date]<=MAX('Date'[Date])&&OR('Staff Population'[End Date]>=MAX('Date'[Date]),ISBLANK('Staff Population'[End Date])))) 


left employee = CALCULATE(COUNTROWS('Staff Population'),FILTER('Staff Population','Staff Population'[End Date] >=MIN('Date'[Date])&&'Staff Population'[End Date]<=MAX('Date'[Date])))

 

Capture.PNG

 

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

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@dzaba , refer to my HR blog. Use MIn(Date[Date] for start of month nad Max(Date[Date])  for end of month

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

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.