Aibloy
Aibloy

Reputation: 157

Add Index without unique values - Power BI / DAX / M

I have a column with Countries (in a table, the column have duplicates) and I need to order them with a index:

  Countries, Desirable index
    A        1
    B        2
    B        2
    C        3 
    D        4
    D        4
    E        5

I can't remove the duplicates because I need the other columns for reference

thanks

Upvotes: 0

Views: 894

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40204

Create a table of only distinct countries, index that table, then merge/join that table back to your existing table (the one with duplicates) and expand the index column you just created.

Upvotes: 1

Related Questions