Forum Discussion
ben-t
3 years agoFrequent Visitor
Help - List.Generate dates with variable frequency in months
Hi, I'm trying to generate a list of jobs to do in the next 2 years I have a working custom column that provides me the list of dates. But my jobs have varying frequencies of 2-12 months intervals...
- 3 years ago
It might be a field access error.
Try
let freq = [FREQUENCY] in each Date.AddMonths( _ , freq))
HotChilli
3 years agoCommunity Champion
It might be a field access error.
Try
let freq = [FREQUENCY] in each Date.AddMonths( _ , freq))
- ben-t3 years agoFrequent Visitor
It generates without issue once i added in this line
Thanks!- GekkeHellie3 years agoRegular Visitor
Hi ben-t,
Could you share the full code that worked for you?
I think I've tried every possible code with the above solution, but I still get an error.
Thanks!
- ben-t3 years agoFrequent Visitor
Hi GekkeHellie
this is the code i used
let freq = [FREQUENCY] in
List.Generate(
() => [Next job],
each Date.From(_) <= Date.From(Date.AddYears(Date.EndOfYear(DateTime.LocalNow()),1)),
each Date.AddMonths(_, freq))