Forum Discussion

BalazsNy's avatar
BalazsNy
Helper I
1 year ago
Solved

Create index column based on criteria (Power Query)

Dear All, I would like to create a kind of index column based on conditions. I have a product ID column and I would like to create an index column in Power Query, which restarts when the produc...
  • pankajnamekar25's avatar
    1 year ago

    Hello BalazsNy 

     

    Group By Product ID (in Power Query).

    Operation for All Rows.

    After grouping, add a Custom Column with the formula

    =Table.AddIndexColumn(_, "Wished index outcome", 1, 1, Int64.Type)

    Expand the resulting tables to flatten the data back out.

     

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.