Forum Discussion
Multiple date columns - Employee Turnover Calculation - pbix attached
You say you have two inactive relationships. That means you have to specify the USERELATIONSHIP() modifier all the time, in all your measures.
Usually the more dominant relationship is kept active, which saves some typing.
How are your users specifying the date intervals? Or are these immutable?
Does that mean I need to also modify the above Headcount measure?
The date intervals are either monthly, year-to-date, or year-to-date of the previous year. The users will want to know the number of hires, number of terminations, and the (average) headcount for each of those intervals.
Hope that helps clarify!
Headcount =
CALCULATE (
COUNTROWS ( 'KAT' ),
FILTER ( VALUES ( 'KAT'[Hire Date] ), 'KAT'[Hire Date] <= MAX ( 'Date'[Date] ) ),
FILTER (
VALUES ( 'KAT'[Termination Date] ),
OR (
'KAT'[Termination Date] >= MIN ( 'Date'[Date] ),
ISBLANK ( 'KAT'[Termination Date] )
)
)
)