PDA

View Full Version : PQ - Expand dates from first to last



sandy666
05-09-2020, 10:38 PM
Expand dates from first to last


DateDates


01/03/2020
01/03/2020


03/03/2020
02/03/2020


07/03/2020
03/03/2020


15/03/2020
04/03/2020


27/03/2020
05/03/2020


06/03/2020


07/03/2020


08/03/2020


09/03/2020


10/03/2020


11/03/2020


12/03/2020


13/03/2020


14/03/2020


15/03/2020


16/03/2020


17/03/2020


18/03/2020


19/03/2020


20/03/2020


21/03/2020


22/03/2020


23/03/2020


24/03/2020


25/03/2020


26/03/2020


27/03/2020



let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
L2T = Table.FromList({Number.From(List.First(Source[Date]))..Number.From(List.Last(Source[Date]))}, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
Type = Table.TransformColumnTypes(Table.RenameColumns(L2T ,{{"Column1", "Dates"}}),{{"Dates", type date}})
in
Type