Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Index column based on duplicates

Hi,

 

I'd like to create an index column following the example below :

IDDATEINDEX
A2021-01-141

B

2021-01-152
C2021-01-152
D2021-01-152
E2021-01-163
F2021-01-163

If the date is the same than the previous row, keep the same index.

If the date is different of the previous one, increment index.

 

Does someone knows how to do that with Power Query ?

 

Thanks in advance

Best regards,

Cado

  • Make a table that just includes the date column .

    Remove Duplicates.

    Add Index Column.

    ---

    Merge the 2 tables based on the date (returning the index column to the original table).

    --

     

    Let me know how it goes

2 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    Make a table that just includes the date column .

    Remove Duplicates.

    Add Index Column.

    ---

    Merge the 2 tables based on the date (returning the index column to the original table).

    --

     

    Let me know how it goes

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi HotChilli 

       

      Thanks for your help, it works perfectly !

       

      Have a nice day,

      Cado