Forum Discussion
Slowly changing dimension
Hi Smoupre,
I couldn't get you.
As i see there a table with column Employee Name , Start Date and EndDate.
But the end user can select any date to know the number of employee on that particular date. So we will reqiure another Date master table containing all dates.
How would you achieve it using the formula you mentioned?
Thanks
Sushant
i got these from @konstantinos
Headcount = COUNTROWS ( FILTER ( Contracts; Contracts[Star Date] <= MAX(Calendar[Date]) && Contracts[End Date] > MAX(Calendar[Date]) ) )
Headcount faster = CALCULATE ( COUNTROWS ( Contracts ); FILTER ( Contracts; Contracts[Start Date] <= MAX ( Calendar[Date] ) ); FILTER ( Contracts; Contracts[End Date] > MAX ( Calendar[Date] ) ) )
Headcount 3 = CALCULATE ( DISTINCTCOUNT( 'Contracts'[EmployeeID]); FILTER ( 'Contracts'; Contracts[Start Date] <= CALCULATE(MAX ( Calendar[Date] ) )); FILTER ( 'Contracts'; Contracts[End Date] >= CALCULATE( MIN( Calendar[Date] ) ) ) )
didn't find the time yet to test