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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Function to search duplicate and rename them differentely

Hello,

I need some help in power query since DAX is case-insensitive.


I have a column like that :

Aho00_1-1654005855303.png

 

Is it possible to create a function in power query that find the "duplicate" and rename them differently?

 

So what i want is to rename these one :
Class_45C to Class_45cc (because Class_45c already exists)

Class_62A to Class_62aa (because Class_62a already exists)

I can do it manually but the problem is for example :

 

If one day in my files i have a Profile named Class_93B, it won't be automatically renamed to Class_93bb since Class_93b already exists.

Thanks.

 

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , first add index column in power query - https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

Then create a rank

Rank = rankx(filter(Table, Table[profile] = earlier(Table[profile])  ), [Index])

 

Then create a column

[profile] & concatenatex(addcolumns(generateseries(2,[Rank],1), "_1", "a"),[_1])

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.