Forum Discussion
Multiple date columns - Employee Turnover Calculation - pbix attached
yes, you need to modify all measures. How else will they know which relationship to use?
Your last code example can be simplified quite a bit
Headcount =
CALCULATE (
COUNTROWS ( 'KAT' ),
'KAT'[Hire Date] <= MAX ( 'Date'[Date] ) ,
COALESCE( 'KAT'[Termination Date], MIN ( 'Date'[Date] )) >= MIN ( 'Date'[Date] ),
)
but it would still be wrong as your MAX and MIN calculations are impacted by the CALCULATE context change. Use variables.
Thank you, can you share what the calculation would look like with variables?
And do you know how I would do the monthly and year-to-date turnover measures?
For example:
- Monthly turnover Jan 2020 = number of terminations in January 2020/January 2020 headcount
- Year to date turnover in March 2020 = (# of terms in Jan + # of terms in Feb + # of terms in Mar)/(Jan headcount + Feb headcount+ March headcount)/3