Forum Discussion
Creating a Power Query loop based on 3 columns
- 3 years ago
You are pretty close.
I put this together for the Custom Column:
Table.AddColumn(#"Changed Type", "Custom", (row) => List.Generate( () => (row[start]), each _ <= row[duedate], each Date.AddMonths(_,6)))start and duedate are dates. I hardcoded the 6 just as an example
You are pretty close.
I put this together for the Custom Column:
Table.AddColumn(#"Changed Type", "Custom", (row) =>
List.Generate( () => (row[start]),
each _ <= row[duedate],
each Date.AddMonths(_,6)))
start and duedate are dates. I hardcoded the 6 just as an example
Thank you HotChilli. I got to the point where I can add hardcoded month, but I just do not know how to put that month into variable which is based on value in other column
- simon1393 years agoFrequent Visitor
Ok I changed the formula and it actually works - thank you so much!!
I would appreciate If you would quickly explain what does the (row) => stands for? And why it works with (row) bud it didn't work without it.
= Table.AddColumn(#"Renamed Columns", "Custom", (row) =>
List.Generate( () => (row[start_date]),
each _ <= row[duedate],
each Date.AddMonths(_,row[billing])))