Forum Discussion
Active Employees per Period
- 9 years ago
Thank you for the advice. I tried it and do not get the correct result, either. What I do get is the number of employees, who left in a specific period (e.g. month).
As I have to deliver the report today, I resolved to take a different approach, showing the number of joiners, leavers and overall evolution of active personnel as in the chart below.
skasper,
Please use the DAX below to calculate Active Employees and check if you get expected result.
Active Employees =
CALCULATE(
COUNTA('crm_employees'[Employee]);
FILTER('crm_employees' , ('crm_employees'[Contract Start] <= LASTDATE('DimDates'[Date])
&& 'crm_employees'[Contract End]>= FIRSTDATE('DimDates'[Date])))
)
Regards,
Thank you for the advice. I tried it and do not get the correct result, either. What I do get is the number of employees, who left in a specific period (e.g. month).
As I have to deliver the report today, I resolved to take a different approach, showing the number of joiners, leavers and overall evolution of active personnel as in the chart below.
- ILAN102010SH9 years agoFrequent Visitor
I have the excat same probles.
please help
- Anonymous7 years agoNot applicable
Hi Sascha,
I like your apporach. I am new to Power BI - and am looking to sort Joiners, Leavers and Active Running total by month, quarter and YTD. Our fiscal year is July-June. Appreciate your help here.
Thanks.
- rl_evans7 years agoHelper II
I encountered this same requirement this week. Here is how I solved it.
# Employees At End of Period =
VAR MaxDate = MAX ( 'Date'[Date] )VAR EmpCnt =
CALCULATE (
COUNTROWS (
CALCULATETABLE ( 'Employees', 'Employees'[HireDate] <= MaxDate, ALL ( 'Date' ) )),
(ISBLANK ( 'Employees'[TerminationDate] ) || 'Employees'[TerminationDate] > MaxDate)
)
RETURN
IF ( ISBLANK ( EmpCnt ), 0, EmpCnt )In my data set, employees that are currently active have a blank termination date. The Calculate function returns Blank, instead of zero, when the count is zero for any given period; which is why the last IF is used after the RETURN.
- Anonymous7 years agoNot applicable
I see that you do take the acocunt for termintation dates in the future, correct ?
Im asking cause it seem that DAX calculation is exactly excluding all of current active employees with a termination date in the future, and cant figure out why that is.
- johan-svitla3 years agoRegular Visitor
I have the same exact issue. Can anybody share how to calculate joiners, leavers, and active running total?
It'd be highly appreciated
- shreeomsingh1 year agoFrequent Visitor
Could you please share your sample power bi pbix file for above chart. it's urgent