Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
mclarke
New Member

Assign to each unique value a number

Hi guys,

I'm trying to assign a numerical code (consecutive ideally but not necessarily) for each unique value from a column. Is there a way to do this?

 

I hope you can help me!!

1 ACCEPTED SOLUTION

@mclarke 

 

Like this ?

ribisht17_0-1653066674488.png

 

Please use this >>> 

RANKXC = RANKX(Sheet4,Sheet4[Category],(Sheet4[Category]))
 
Regards,
Ritesh

 

View solution in original post

5 REPLIES 5
ribisht17
Community Champion
Community Champion

@mclarke 

 

Please post some sample data here

 

Regards,

Ritesh

ribisht17
Community Champion
Community Champion

@mclarke 

 

You can definitely add INDEX column 

 

Solved: Rank for unique values - Microsoft Power BI Community

 

ribisht17_0-1653061100952.png

 

 

Regards,

Ritesh

Thank you for answering. This generates a new value for each row, I need only new numbers on new values

@mclarke 

 

Like this ?

ribisht17_0-1653066674488.png

 

Please use this >>> 

RANKXC = RANKX(Sheet4,Sheet4[Category],(Sheet4[Category]))
 
Regards,
Ritesh

 

Thank you! I've sorted it another way (duplicated column in another table, removed duplicates and indexed), but this is even better.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.