Reply
Frequent Visitor
Posts: 10
Registered: ‎06-06-2018
Accepted Solution

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


Accepted Solutions
Member
Posts: 49
Registered: ‎11-27-2018

Re: Is there a function for counting work days in a month

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:

Capture.PNGResult

Hope this helps!


Kind Regards,

Jelte

View solution in original post


All Replies
Member
Posts: 49
Registered: ‎11-27-2018

Re: Is there a function for counting work days in a month

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:

Capture.PNGResult

Hope this helps!


Kind Regards,

Jelte

Highlighted
Frequent Visitor
Posts: 10
Registered: ‎06-06-2018

Re: Is there a function for counting work days in a month

Thanks Jelte.

 

Pete