Forum Discussion

Cul33's avatar
Cul33
Frequent Visitor
8 years ago
Solved

Assigning values to increments in a loop

I have a column of data comprising blocks of 3 entries.  Each block of 3 is unique and I need to add a new column which contains n an incremental value for each of the entries within each block as A,...
  • Phil_Seamark's avatar
    Phil_Seamark
    8 years ago

    Hi Cul33

     

    In Power query, I would

     

    1. Add an index to the core table
    2. take a copy of the table.
    3. group the copied table by the first three columns - adding a MIN aggregation column
    4. Merge the grouped table back to the original table including the new [offset] column
    5. create a NEW column that subtracts the offset from the index to generate a number that can be converted to ABC
    6. remove the interum columns.