cancel
Showing results for
Search instead for
Did you mean:
Highlighted
Frequent Visitor

## Counting Number of Working Days

Hi All,

I would appreciate some help please.

I need to count the number of working days between a date range. I have created a new Table using

MyDate = CALENDARAUTO() and have a Visual Slicer to select the date range. I now want to determine the working hours between those dates so that I can calculate my Utilization %.

My expression doesn't work. I have tried a new Measure :
NoOffWorkingHours = COUNTX(MyDate;if(WEEKDAY(MyDate[Date].[Day];2)<6;1;0))*8

It is counting weekend days as well as weekdays.  Anyone that can spot my error?

In essence, how do I count the number of workdays between the date ranges?
1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

## Re: Counting Number of Working Days

Thanks all,

I manage to solve it by using Sumx in place of Countx

NoOffWorkingHours = SUMX(MyDate;if(WEEKDAY(MyDate[Date].[Day];2)<6;1;0))*8
1 REPLY 1
Frequent Visitor

## Re: Counting Number of Working Days

Thanks all,

I manage to solve it by using Sumx in place of Countx

NoOffWorkingHours = SUMX(MyDate;if(WEEKDAY(MyDate[Date].[Day];2)<6;1;0))*8

## Helpful resources

Announcements

#### Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors