Forum Discussion

simon139's avatar
simon139
Frequent Visitor
3 years ago
Solved

Creating a Power Query loop based on 3 columns

Hi Guys,  I am not too good in Power Query / M language so really need your help here. I have a Python script which is working in PQ, but I need to rewrite it to 'M Language' as Power BI GateWay d...
  • HotChilli's avatar
    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