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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

create index from existing data with duplicates

Hi folks, Can anyone help me with this one? I have a column of data which includes duplicates which I want to add a sequence number to so they become unique. e.g. F01 F01 F02 F03 would become F01-1 F01-2 F02-1 F03-1 I can think of a long-winded way to do it but I suspect there is an easy way.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , first of add index in power query

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

then create a new column in dax like this

 

New column = [Column1] & " - " & countx(filter(Table, [Column1] = earlier([Column1]) && [index] <= earlier([index])),[Column1])

 

assume Column1 is the column having F01 F01 F02 F03

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , first of add index in power query

https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

then create a new column in dax like this

 

New column = [Column1] & " - " & countx(filter(Table, [Column1] = earlier([Column1]) && [index] <= earlier([index])),[Column1])

 

assume Column1 is the column having F01 F01 F02 F03

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Is there a way to do this in M Code in Excel?

Anonymous
Not applicable

I did manage to do this by splitting into columns using a delimiter and then unpivot command.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors