Forum Discussion
ArchStanton
2 years agoPower Participant
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...
- 2 years ago
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' ) ) ) - 2 years ago
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.
DataInsights
2 years agoSuper User
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' ) ) )
ArchStanton
2 years agoPower Participant
That works perfectly - thank you!