I am trying to calculate the percentage of employees in Branch with a date slicer. My original data is a lot bigger and has duplicates. Also, I cannot used the grand total here since I will be needing it for another calculation afterwards.
My formula to calculate the percentage of employees is: % of Employees = CALCULATE(DIVIDE (DISTINCTCOUNT(tEmployee[EmpID]), CALCULATE(DISTINCTCOUNT(tEmployee[EmpID]), ALLSELECTED(tEmployee))), FILTER(VALUES(tEmployee[Enter Date]),tEmployee[Enter Date] <= MAX(Dates[Date])), FILTER(VALUES(tEmployee[Leave Date]),tEmployee[Leave Date] >= MIN(Dates[Date])))
%Employees.pbix (131.5 KB)
However, it is not bringing in the correct percentage. Both the branc names and dates are a slicer here and users will be able to select all of the brances or just one branch at a time. I am attaching the file below. Please let me know what I might be doing incorrectly here.