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
AA1996
Frequent Visitor

Count of Workdays excluding out of office days

I've created a function that tells me the number of workdays since a project has started excluding weekends, however I now want to filter it by the days where work was completed by an employee (so don't count a day as a workday if no work was done WHERE 'Production'<2) 

 

I've created the following Measure:

Work Days on Project Before Today = COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR("1/1/2020",TODAY()),"Day of Week",WEEKDAY([DATE],1)),[Day of Week]<>1 && [Day of Week]<>7))
This returns the number of work days since the project was started, however some employees take vacation so the number of workdays
varies from employee to employee how do I return the number of workdays for each individual employee using a column named "production"
Where im determining if the employee has a production values of less than 2 then they were out for the day and I wouldn't want it counted towards their number of workdays
 
Side Note: I created an additional measure 
Was Employee in = IF(COUNT('employee'[production])>2,1,0)
However when i added it to a matrix table along with employees and dates the rows don't add up across to give me a total of the number of days worked, it returns the value 1 instead of a row total
 
3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @AA1996

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help anyone in the community find the solution easily if they face the similar problem with you. Thank you.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yiruan-msft
Community Support
Community Support

Hi @AA1996 ,

According to your case description, do you want to calculate the number of working days for each employee? And it needs to exclude weekends and the day which the production is less than 2? As checked the measure " Work Days on Project Before Today", it will only return the number of working days from 2020.1.1 to today not for the working days for each employee. Could you please provide some sample data (exclude sensitive data) so that it will be easier to write measure that is suitable for your scenario.

 

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

Refer if work day count in this file can help

 

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.