Hallo,
I'm trying to calculate how much an employee is spending time on actual projects:
'productivity' = [total hours worked on projects] / [total hours that the employee was available]
I've given a schema like:
WorkDone = (employee_id, date, project_id, hours) HoursAvailable = (employee_id, date, available_hours)
So to calculate productivity, I have a measure in WorkDone table:
productivity = Sum(WorkDone.hours)/Sum(HoursAvailable.hours)
In powerBi desktop, I have a page where I do a range of analysis on WorkDone, and it includes a date filter (Timeline control).
The problem: after a date range is selected, rows on WorkDone are filtered and if there is no work done by the employee in those dates, nothing is selected (0 hours worked), but the filter also propagates to HoursAvailable and I get also 0 for hours available.
So I guess I should be using ALL with FILTER in the denominator, but I'm not sure how to access the dates chosen by user.
What do you guys suggest?