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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.