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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors