Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Anonymous ,

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

    Establish the relationship between the calendar table and the holiday table

    Then add a calculated column behind the calendar table

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

     

    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.