Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Inconsistent holiday

Background: 

The company took the following holidays for 2018 - 

  • New Year’s Day (Jan 1)
  • Presidents’ Day (Feb 19)
  • Memorial Day (May 28)
  • Independence Day (July 4)
  • Labor Day (Sept 3)
  • Thanksgiving Day & day after (Nov 22 & 23)
  • Christmas Eve & Christmas Day (Dec 24 & 25)
  • New Year’s Eve (Dec 31)

However, in previous years, the Presidents' Day was NOT a holiday and MLK Day WAS a holiday.

 

I have a date table which contains all dates and corresponding holiday names with dates.I also have all the weekdays with 0=Sunday, 1=Monday, etc.  I would like to create a new column that is True False for working day vs. nonworking day. How do I create a column that reflects all years? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Create a new table called holiday to store the holiday information such as below.

2018-04-26_9-35-00.png

Create relationship between the holiday table with your original calendar table.

 

 

2018-04-26_9-38-07.png

 

Then use the following Dax to create a calcuated column to mark the working days

 

 

Isworkingday = IF('Calendar'[Weekday]>0&&'Calendar'[Weekday]<6&&COUNTX(RELATEDTABLE(Holiday),1)<1,"Yes","No")

2018-04-26_9-40-48.png

 

 

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Create a new table called holiday to store the holiday information such as below.

2018-04-26_9-35-00.png

Create relationship between the holiday table with your original calendar table.

 

 

2018-04-26_9-38-07.png

 

Then use the following Dax to create a calcuated column to mark the working days

 

 

Isworkingday = IF('Calendar'[Weekday]>0&&'Calendar'[Weekday]<6&&COUNTX(RELATEDTABLE(Holiday),1)<1,"Yes","No")

2018-04-26_9-40-48.png

 

 

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.