Forum Discussion

PaulMac's avatar
PaulMac
Icon for Helper IV rankHelper IV
7 years ago
Solved

Count Working Days Excluding Weekend and Holidays

Hello, I would like help to produce a column that counts the number of working days between the Date Received column and the Date Acknowledged column that excludes dates that fall on weekends and UK...
  • Cmcmahan's avatar
    7 years ago

    Sure. I added this measure as another value in the table you provided:

    Working Days = 
    COUNTROWS( 
        FILTER(
            ALL(DateDimension), 
            DateDimension[Day of Week] <> 5 && DateDimension[Day of Week] <> 6 && 
            DateDimension[Is Public Holiday?] = "No" && 
            DateDimension[Date] < SELECTEDVALUE(Data[Date Acknowledged]) && 
            DateDimension[Date] >= SELECTEDVALUE(Data[Date Received]) 
        ) 
    )

    I wasn't sure whether to count the day it was acknowledged or the day it was received in the count, so I just picked one.  For example, if an item was acknowledged and then received on the next day, should that be 1 (since one day has passed) or 2 (there have been 2 calendar days involved)?  If it was acknowledged on Friday and recieved on Sunday, should that be 1(counting Friday) or 0 (since no business days have passed since acknowledgement)?  Change the less than/greater than or equal to signs accordingly.