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
Chalklands
Helper I
Helper I

Is there a function for counting work days in a month

Hi,

I'm trying to calculate the total number of working days in the current month. Can anybody suggest a measure/function that would do this?

 

Thanks

 

Pete

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Pete,

 

You should use the following Dax codes in your date dimension by adding custom columns:

Day of Week = WEEKDAY('Date'[Date];2)
WorkDay = IF(OR('Date'[Day of Week] =6; 'Date'[Day of Week] = 7); "No"; "Yes")

Then you need to create the following measure:

Workdays = CALCULATE(COUNT('Date'[WorkDay]); FILTER('Date'; 'Date'[WorkDay] = "Yes"))

This is the result:

ResultResult

Hope this helps!


Kind Regards,

Jelte

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Pete,

 

You should use the following Dax codes in your date dimension by adding custom columns:

Day of Week = WEEKDAY('Date'[Date];2)
WorkDay = IF(OR('Date'[Day of Week] =6; 'Date'[Day of Week] = 7); "No"; "Yes")

Then you need to create the following measure:

Workdays = CALCULATE(COUNT('Date'[WorkDay]); FILTER('Date'; 'Date'[WorkDay] = "Yes"))

This is the result:

ResultResult

Hope this helps!


Kind Regards,

Jelte

Thanks Jelte.

 

Pete

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.