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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.