Forum Discussion
Create a new table with multiple rows for each ID based on date.
- 7 years ago
Anonymous
With Query EditorAdd this Custom Column
={Number.From([Start])..Number.From([End])}Now Expand it to new rows
Now convert this column into date format
Hi Anonymous
USing Edit Query on the table
Paste the following code in the Advanced Editor
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRMjDUByIjA0NLKMcYxjE1AAKlWB2QSkOopBFM0tAUiWNkClYZCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [ID = _t, StartDate = _t, EndDate = _t, Number = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"StartDate", type date}, {"EndDate", type date}, {"Number", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "ListGen", each List.Transform({Number.From([StartDate])..Number.From([EndDate])}, each Date.From(_))),
#"Expanded ListGen" = Table.ExpandListColumn(#"Added Custom", "ListGen"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded ListGen",{{"ListGen", type date}})
in
#"Changed Type1"
Change the Source with your table.
If this works for you mark this as solution and also give KUDOS.
Cheers
CheenuSing