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
PADDYN78
New Member

Calculating Monthly Average Headcount for Employee Turnover Calculation

Hello All,

 

I am very very new to PowerBI and I am in the process of setting up an HR Dashboard. To calculate the turnover on a monthly basis I am trying to calculate the average headcount for each month. the data in the table is set up as below

 

Employee No.Commenced OnTerminated On
03541/04/20107/03/2022
071118/03/2014 
07772/07/2014 
08098/09/2014 
010352/01/20194/12/2019
106114/08/2017 
106214/08/201711/11/2019

 

I wrote the following measure to calculate monthly average headcount:

 

Average Monthly Headcount =
(
(
Var openinghc=
CALCULATE(COUNTROWS(FILTER(EMPTABLE),
(EMPTABLE[Commenced On]<= MIN(DATE_TABLE[MonthYear]))))
)

RETURN
(
var newjoiners=
CALCULATE(COUNTROWS(FILTER(EMPTABLE),
(EMPTABLE[Commenced On]<= MAX(DATE_TABLE[MonthYear])))))

RETURN
(
var terminations=
CALCULATE(COUNTROWS(FILTER(EMPTABLE,
(EMPTABLE[Terminated On]<=MAX(DATE_TABLE[MonthYear])))
)
)

RETURN
(
Var closinghc=
((openinghc+newjoiners)-terminations)

RETURN

CALCULATE(DIVIDE((openinghc+closinghc),2))
)
)
)
)
)

 

I dont get the right numbers using this solution. 

What am I doing wrong and How can i correct this?

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

My approach would be to create one row for each month for each employee.  So for someone who joined in 2010 and resigned in 2013, then will be 12*13=156 rows.  This will result in a very large table.  Are you amenable to this approach?  If yes, then show the result of average employee headcount for any oen month.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@PADDYN78 , Refer the approch

Average of Rolling, Average of Snapshots: https://youtu.be/_pZRdLAJxxA


Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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