Here’s the final result and the Date table full query.
let
EndDate = #date(2021, 12, 31),
StartDate = #date(2017, 1, 1),
Custom = List.Dates(Date.From(StartDate), Number.From(EndDate) - Number.From(StartDate) +1 ,#duration(1,0,0,0)),
#"Convert List to Table" = Table.FromList(Custom, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Change Type" = Table.TransformColumnTypes(#"Convert List to Table",{{"Column1", type date}}),
#"Rename Column" = Table.RenameColumns(#"Change Type",{{"Column1", "Date"}}),
Year = Table.AddColumn(#"Rename Column", "Year", each Date.Year([Date]), type number),
#"Month Number" = Table.AddColumn(Year, "Month Number", each Date.Month([Date]), type number),
#"Month Name" = Table.AddColumn(#"Month Number", "Month Name", each Text.Start(Date.MonthName([Date]),3), type text),
Day = Table.AddColumn(#"Month Name", "Day", each Date.Day([Date]), type number),
Qtr = Table.AddColumn(Day, "Qtr", each "Q" & Number.ToText(Date.QuarterOfYear([Date])),type text),
#"Year-Qtr" = Table.AddColumn(Qtr, "Year-Qtr", each Text.Combine({Text.From([Year], "en-US"), [Qtr]}, "-"), type text),
StartOfQuarter = Table.AddColumn(#"Year-Qtr", "StartOfQuarter", each Date.StartOfQuarter([Date]), type date),
EndOfQuarter = Table.AddColumn(StartOfQuarter, "EndOfQuarter", each Date.EndOfQuarter([Date]), type date),
EndOfMonth = Table.AddColumn(EndOfQuarter, "EndOfMonth", each Date.EndOfMonth([Date]), type date),
DayOfYear = Table.AddColumn(EndOfMonth, "DayOfYear", each Date.DayOfYear([Date]), type number),
WeekDay = Table.AddColumn(DayOfYear, "WeekDay", each Date.ToText([Date], "ddd"),type text),
#"Inserted Merged Column" = Table.AddColumn(WeekDay, "MonthYear", each Text.Combine({[Month Name], Text.End(Text.From([Year], "en-US"),2)}, "-"), type text),
#"Added Custom1" = Table.AddColumn(#"Inserted Merged Column", "T&M Qtr-Start", each if List.Contains({3, 6, 9, 12}, [Month Number]) = false then ""
else if [Day] < 16 or [Day] > 22
then ""
else if [WeekDay] = "Sat"
then [Date]
else ""),
#"Added Custom" = Table.AddColumn(#"Added Custom1", "T&M Qtr-End", each if List.Contains({3, 6, 9, 12}, [Month Number]) = false then ""
else if [Day] < 15 or [Day] > 21
then ""
else if [WeekDay] = "Fri"
then [Date]
else ""),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"T&M Qtr-Start", type date}, {"T&M Qtr-End", type date}}),
#"Filled Down" = Table.FillDown(#"Changed Type",{"T&M Qtr-Start"}),
#"Filled Up" = Table.FillUp(#"Filled Down",{"T&M Qtr-End"}),
#"Inserted Year" = Table.AddColumn(#"Filled Up", "T&M Year", each Date.Year([#"T&M Qtr-End"])),
#"Inserted Quarter" = Table.AddColumn(#"Inserted Year", "T&M Qtr", each "Q" & Number.ToText(Date.QuarterOfYear([#"T&M Qtr-End"])),type text),
#"Inserted Merged Column1" = Table.AddColumn(#"Inserted Quarter", "T&M Year-Qtr", each Text.Combine({Text.From([#"T&M Year"], "en-US"), [#"T&M Qtr"]}, "-"), type text)
in
#"Inserted Merged Column1"
Best regards,
Ferdinand