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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
jdevries192
Frequent Visitor

DAX: Calculate Hires and Terminations

Hi All,

 

Looking to calculate with DAX new hire retention in a given month based on an activity table. Issue is an employee may be hired and terminated many times (see employee 1 in example below). So I can't pivot the table to determine hire and termination dates in a given timeframe.

 

Calculation is (Ending Month's Continuous Headcount / Starting Month's Headcount)

 

Example Data below:

EmployeeActivityDate
1Hire1/1/2022
2Hire1/1/2022
1Termination1/5/2022
3Hire1/31/2022
4Hire1/31/2022
3Termination2/2/2022
1Hire2/5/2022
2Termination2/5/2022
1Termination2/6/2022
1Hire2/20/2022

 

For February, Employees 2, 3, and 4 were active at the start of the month. But only Employee 4 was active at the start and end of the month. So the calculation would be:

 

1/3 = 33%.

 

Any help would be appreciated.

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@jdevries192 , With help from date table joined to your date of the table

 

Active Employees = calculate(distinctCOUNT(EmpData[ID]) , filter(EmpData, EmpData[Date] <= max(Date[Date]) && [Activity] = "Hire" ))
- calculate(distinctCOUNT(EmpData[ID]) , filter(EmpData, EmpData[Date] <= max(Date[Date]) && [Activity] = "Termination" ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

You are counting all hires and terminations.

 

I need those who are still active at the start of February (who have been hired but not terminated). And I need those who were active at the start of February and who are still active at the end of February.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.