Holiday Table Generator in Power Query M

Flags dates in a date table that match a manually maintained list of holiday dates.

Date & TimeIntermediateholidaycalendardate tableflag

Power Query M code

let
    Source = YourDateTable,
    Holidays = {#date(2026, 1, 1), #date(2026, 7, 4), #date(2026, 12, 25)},
    AddedIsHoliday = Table.AddColumn(Source, "IsHoliday", each List.Contains(Holidays, [Date]), type logical)
in
    AddedIsHoliday

Generate a date table in Power Query M

Notes

Update the Holidays list with your own dates, or point it at a separate holiday table using List.Contains(HolidayTable[Date], [Date]).

Requirements

How to use this snippet

  1. In Power BI Desktop, choose Transform data to open Power Query, then open the Advanced Editor on a query (or start from a blank query).
  2. Paste the snippet and replace the placeholder names (tables, columns, file paths) with your own. Check the requirements above first.
  3. Run it through the Power Query M Formatter to tidy the layout.

Related Power Query M snippets

More Power Query M resources

Browse all 145 snippets in the Power Query M Code Snippets, or search the library for something similar to Holiday Table Generator.