Forum Discussion
Jurekbartlomiej
3 years agoNew Member
List.generate help
Hi everyone ! Based on the data from the "Input" table, I would like to get the data as in the "Output" table. I tried to use list.generate, however, I can't get over it yet. code: List....
alena2k
Resolver IV
3 years agoHi Jurekbartlomiej you can do it if you move list generation into the function and then add column via Invoke Custom Function
getDates
(DateStart as date, DateEnd as date) =>
let
Source = List.Generate(()=> DateStart,each _ < DateEnd,each Date.AddMonths(_,1))
in
Source
main query
let
Source = .....,
#"Invoked Custom Function" = Table.AddColumn(Source, "Custom", each getDates([startDate], [endDate])),
#"Expanded Custom" = Table.ExpandListColumn(#"Invoked Custom Function", "Custom"),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"Custom", type date}})
in
#"Changed Type"