I'm attempting to count the days not worked. Any suggestions?
Fact Table:
Date_Key | Employee Name | Date Hired | Date Terminated | Hours
Date Table:
Date_Key | Date | WeekendOrWeekday | IsHoliday
So far I have the below working but unfortunately it's counting days before the employee was hired and after they were terminated. How can I filter it to just the context between the Employee's Date Hired and Date Terminated?
Thanks!
Fact Table:
Date_Key | Employee Name | Date Hired | Date Terminated | Hours
Date Table:
Date_Key | Date | WeekendOrWeekday | IsHoliday
So far I have the below working but unfortunately it's counting days before the employee was hired and after they were terminated. How can I filter it to just the context between the Employee's Date Hired and Date Terminated?
Code:
Count of Non-Holiday Weekdays Not Worked :=CALCULATE (
COUNTX (
VALUES ( 'Date Table'[Date] ),
IF ( [Sum of Hours] = 0, 1 )
),
'Date Table'[IsHoliday] = FALSE (),
'Date Table'[WeekendOrWeekday] = "Weekday"
)
Thanks!