PDA

View Full Version : PQ - Fridays between dates for whole year



sandy666
07-12-2023, 04:09 AM
Fridays


13/01/2023


17/02/2023


17/03/2023


14/04/2023


12/05/2023


16/06/2023


14/07/2023


18/08/2023


15/09/2023


13/10/2023


17/11/2023


15/12/2023



// Query1
let
Source = List.Dates(#date(2023, 01, 01), 366, #duration(1, 0, 0, 0)),
C2T = Table.FromList(Source, Splitter.SplitByNothing(), type table[Date = Date.Type], null, ExtraValues.Error),
DayN = Table.AddColumn(C2T, "Day Name", each Date.DayOfWeekName([Date]), type text),
Friday = Table.SelectRows(DayN, each ([Day Name] = "Friday")),
DayNum = Table.AddColumn(Friday, "Day", each Date.Day([Date]), Int64.Type),
Range = Table.SelectRows(DayNum, each [Day] >= 12 and [Day] <= 18),
Ren = Table.RenameColumns(Range,{{"Date", "Fridays"}}),
TSC = Table.SelectColumns(Ren,{"Fridays"})
in
TSC