Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

List.Generate too slow

Hi everyone,

 

I have a table with the contracts of all customers, where I have the start date and end of these contracts.
I'm using List. Generate to repeat the month-to-month dates to be able to relate to my calendar table and compare month to month with my recipe.
But that way is too heavy and slow, repeating the information in several months, do you know any other way?
Follow the way I'm doing it:

 

= Table.AddColumn(#"Tipo Alterado1", "Meses", each Table.AddColumn(#"Tipo Alterado1", "Months", each let mystart=[CN9_DTINIC], myend=[CN9_DTFIM] in
List.Generate(()=>Date.EndOfMonth(mystart),each _ <= Date.EndOfMonth(myend),each Date.AddMonths(_,1))))

2 Replies