The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Community,
I have a measure which Calculates the DistinctCount of employees who worked in a Project.
I need to divide a measure with working Hours, by this distinct count. I need the result for further calculation. The current Problem is, that in the Employee Context, the Count does not show the total amount of employees.
Example:
750 Working Hours, DistinctCount Result is 3 Employees -> 250 Hours per Employee
But on the Employee Level its 750 Working Hours, Distinct Count Result is 1 Employee. -> 750 Hours per Employee
I used ALL and also ALLEXCEPT but did not manage to get a proper result.
VAR CountofEmployees = Calculate (
Distinctcount(FactTable[EmployeeID]),
ALL(FactTable[EmployeeID],
FILTER(FactTable, Related(DimProject[ID]) = 1))
VAR Calculation = DIVIDE([Working Hour MEasure], CountOfEmployees)
RETURN
CALC
Appreciate any help 🙂
Hi @BIlix for distinctcount of employees usually Distinctcount(FactTable[EmployeeID]) should be fine.
Try CountofEmployees = Distinctcount(FactTable[EmployeeID])
Did I answer your question? Mark my post as a solution! Kudos Appreciated!
Proud to be a Super User!
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
28 | |
13 | |
12 | |
12 | |
6 |