Forum Discussion
Count Working Days Excluding Weekend and Holidays
- 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.
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.
PaulMac you can also try following measure
Days Count =
VAR __dateTable =
CALENDAR ( MAX ( Data[Date Received] ), MAX ( Data[Date Acknowledged] ) )
VAR __table =
INTERSECT (
__dateTable,
CALCULATETABLE (
VALUES ( DateDimension[Date] ),
ALL ( DateDimension ),
DateDimension[Is Public Holiday?] = "No",
DateDimension[Day of Week] <= 4
)
)
RETURN
COUNTROWS ( __table )