Forum Discussion

CliffordAP's avatar
CliffordAP
Helper II
4 years ago
Solved

Power Query - Custom Column tracking when the value of another column changes

Hello all! I have a small question. Is there a way I can create a custom column that will numerically add 1 each time the value of another column changes? A A A B B C A A ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    You can first sort like you have it, then Table.Buffer, then Group By Column1 and add an All Rows aggregation--but then go back to that step and add the optional parameter GroupKind.Local. 

    From there, you can add an index column starting at 1. Then Remove the columns except the table column and the index column. Now expand the table column, and you are all set.

     

    --Nate