Forum Discussion

BmBogers's avatar
BmBogers
New Member
8 years ago
Solved

Using and manipulating a variable in if statement in Power query

Hello,    I wrote some code in the advanced editor, the goal of this code is to count the difference in days between the current record and the previous record in a certain group. I managed to do t...
  • MarcelBeug's avatar
    8 years ago

    In general, "looping" is not often required in Power Query.

     

    My suggstion wold be to first add an Index column and next add a column: with the Index value if a new group must start, and null if it is the same group.

     

    Next you can filldown the values in the column, so you hve all the same values within each group.

     

    A bit short explanation as I have other priorities now; hopefully it helps and otherwise I can take another look later today.