Forum Discussion

ArchStanton's avatar
ArchStanton
Power Participant
2 years ago
Solved

Working Days

I have a Working Days column that produces True / False in my Calendar that works perfectly fine:   Working Days = NOT WEEKDAY('Date'[Date]) IN {1,7}   I would like to incorporate my Public Hol...
  • DataInsights's avatar
    2 years ago

    ArchStanton,

     

    Try this calculated column in your Date table. It requires a 1:* relationship between Date and bank-holidays.

     

    Working Days = 
    NOT WEEKDAY ( 'Date'[Date] ) IN { 1, 7 } && ISBLANK ( COUNTROWS ( RELATEDTABLE( 'bank-holidays' ) ) )

     

  • DataInsights's avatar
    DataInsights
    2 years ago

    ArchStanton,

     

    The two expressions are evaluated independently. The first one works as described (check if Date is a weekend). The second one checks if the date in the current row of the Date table exists in bank-holidays table; if it doesn't, then it's considered a working day (assuming it's not a weekend). The assumption is that bank-holidays contains only holidays. Hope that helps.