Counting Workday between 2 dates

I am trying to determine the count of days between the created date and the closed date, but not include the weekends or holidays. I have created true/false columns for weekdays and holidays in my date table to filter from. Below is an example of the dax formula I am trying to use, but I am obviously missing something.

The dax works, but i get an error (also pictured below.)

I have tried to find my answer online, and tried many options found, but nothing seems to be working.

Thank you in advance for your assistance.


1 Like

Hello @Jackie,

Is is mandatory to have it calculated like this?
I’m asking because I would just add a 1 or 0 column in Power Query for the working and non-working days and use a simple sum as a measure with DATESBETWEEN function.


i am attaching the solution from the best guy in the business. refer script

Sales[DeliveryWorkingDays] =
COUNTROWS ( ‘Date’),
DATESBETWEEN ( ‘Date’[Date], Sales[Order Date], Sales[Delivery Date] – 1 ),
‘Date’[IsWorkingDay] = TRUE,
ALL ( Sales )