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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Creating conditional column based on date, IsHoliday

Hi All,

 

I have a column of datetimes for all of 2019 and I want to create a conditional column 'IsHoliday' that is '1' if that date is a public holiday, and '0' otherwise.

I imagine for New Year's Day it would be something like:

 

IsHoliday = IF( 'Table'[Date] = DATE(2019,1,1), 1, 0)

 

However this only returns '1 'for one value but not all the the other datetimes on that date.

Any help would be appreciated.

 

Brian

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , weekend are easy, for public holday you might have use API, refer this power bi solution for that

 

Work Day = if(WEEKDAY([Date],2)>=6,0,1)

 

you can lso copy holday from other tables to date table

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi  @Anonymous ,

You need to get a list of holidays online, such as the following:

vyangliumsft_0-1637283623643.png

Establish the relationship between the calendar table and the holiday table

vyangliumsft_1-1637283623646.png

Then add a calculated column behind the calendar table

IsHoliday =
IF(
    ISBLANK(RELATED('2019 Holiday'[Date]))=FALSE(),
    1,0)

vyangliumsft_2-1637283623647.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

You need to get a list of holidays online, such as the following:

vyangliumsft_0-1637283623643.png

Establish the relationship between the calendar table and the holiday table

vyangliumsft_1-1637283623646.png

Then add a calculated column behind the calendar table

IsHoliday =
IF(
    ISBLANK(RELATED('2019 Holiday'[Date]))=FALSE(),
    1,0)

vyangliumsft_2-1637283623647.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Awesome mate, cheers

amitchandak
Super User
Super User

@Anonymous , weekend are easy, for public holday you might have use API, refer this power bi solution for that

 

Work Day = if(WEEKDAY([Date],2)>=6,0,1)

 

you can lso copy holday from other tables to date table

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors