Forum Discussion

NewbieJono's avatar
NewbieJono
Post Partisan
4 years ago
Solved

Working day, not include Bank Holiday or Weekend

i am trying to add a marker in my table to say if its a working day. this code does not seem to work. i think its the line regarding bank holiday

 

 

IsWorkingDay = IF 
            (NOT('DIM - Date Table'[weekday]= 6 ||
                ('DIM - Date Table'[weekday]= 7)) ||
                'DIM - Date Table'[Date] IN DISTINCT ('DIM - Bank Holidays'[Holidays]),
1,0)

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    HI NewbieJono,

    I think the workday rule should be not the weekend and not included in the holiday table records, right? If that is the case, you can try to use the following formulas:

    IsWorkingDay =
    IF (
        WEEKDAY ( 'DIM - Date Table'[weekday], 2 ) < 6
            && NOT ( 'DIM - Date Table'[Date] IN ALL ( 'DIM - Bank Holidays'[Date] ) ),
        1,
        0
    )

    Regards,
    Xiaoxin Sheng

4 Replies

  • which side is one and which side is many? Why it would be one to many? 

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI NewbieJono,

    I think the workday rule should be not the weekend and not included in the holiday table records, right? If that is the case, you can try to use the following formulas:

    IsWorkingDay =
    IF (
        WEEKDAY ( 'DIM - Date Table'[weekday], 2 ) < 6
            && NOT ( 'DIM - Date Table'[Date] IN ALL ( 'DIM - Bank Holidays'[Date] ) ),
        1,
        0
    )

    Regards,
    Xiaoxin Sheng