Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
WorkHard_
Frequent Visitor

Calculate # of employees per task when an employee is assigned multiple times per task

What would be the correct way to calculate this following scenario:

TaskEmployee
1Employee1
1Employee2
1Employee2
1Employee3
1Employee4
1Employee5
2Employee1
2Employee2
2Employee3
2Employee 4

 

Notice, one employee is assigned twice which is normal in this dataset.
Using this measure formula I get:

 

 

 

 

 

#ofemployees_per_task = CALCULATE(DISTINCTCOUNT(Table1[EmployeeID])/DISTINCTCOUNT(Table1[ProjectID]))

 

 

 

 

 

Which is correct.

Task# of Employees
15
24

 

However, when looking at the total, this is not correct:

# of tasks # of employees
25


Instead, the desired result is:

# of tasks # of employees
29

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

2 REPLIES 2
Ahmedx
Super User
Super User

pls try this

Screenshot_4.png

Ashish_Mathur
Super User
Super User

Hi,

I am very confused about what you want.  Anyways, if you want to add the number of employees for both tasks, then try these measures:

Employee count = distinctcount(Table1[EmployeeID])

Measure = SUMX(VALUES(Table1[Task]),[Employee count])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.