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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
byronp
Frequent Visitor

Measure for Distinct Counts of days employees worked

Good Afternoon all, 

 

Please need help on solving this one !!!! 

 

I have a table iin_costs that has a list of all the hours employee's worked over a date range. They do a number of tasks throughout the day and there is more than three employees (but for the example i have just used three). 

iin_users.namereference dateHours worked Task
John Smith22/11/213.51
John Smith22/11/2112
John Smith22/11/2112

Rebecca Smith

22/11/2111
Rebecca Smith22/11/2123
Wayne Smith22/11/213.51
John Smith23/11/213.51
John Smith23/11/2112

Rebecca Smith

23/11/2111
John Smith24/11/213.51
John Smith24/11/2112

Rebecca Smith

24/11/2111
Rebecca Smith24/11/2123
Wayne Smith24/11/213.51
John Smith25/11/2112
John Smith26/11/2112
Rebecca Smith26/11/2123

 

 

What i would like is a measure so that i can display it on a card and to use for various other calculations that will display the number of employees that were working over any given date range (which will be a silcer) 

 

Eg. for the dates 22/11 through to 26/11  the number of employees that worked were 11 (John Worked 5 days, Rebecca Worked 4 days, Wayne worked 2 days)

 

I have tried this 

Measure = CALCULATE(DISTINCTCOUNT(iin_costs[reference_date]),  GROUPBY(iin_costsiin_costs[reference_date],iin_costs[iin_users.name]))
 
But that does not give me the count of the number of days John worked + the number of Days that Rebecca worked + the number of days Wayne worked. 
 
It just counts the distinct days that any person showed up for work which is 5. 
 
How do i get to count the number of days my distinct employees worked per employee then summed?
 
Cheers, 
Byron
1 ACCEPTED SOLUTION
byronp
Frequent Visitor
1 REPLY 1
byronp
Frequent Visitor

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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