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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Homaa
Frequent Visitor

How to rename a duplicated value in a column?

there is a table that has two columns (id, name). there is a value in "name" column as "ABC Kitchen" which has two separate _ids but the same name. I want to change the name for the one that _id is "12345" to "ABC Kitchen (old)".
I tried to add a step to replace value

 

= Table.ReplaceValue(#"PreviousStepName", "ABC Kitchen (old)", each if [id] = "12345" then "ABC Kitchen (old)" else [name], Replacer.ReplaceText,{"name"})

 

but it didn't change the name. I also tried this

 

= Table.TransformColumns(#"PreviousStepName", {{"name", each if [id] = "12345" then "ABC Kitchen (old)" else _, Text.Type}})

 

but this time, I got error for all values in the column. Do you have any suggestion for me?

1 ACCEPTED SOLUTION
mlsx4
Memorable Member
Memorable Member

@Homaa 

Then, change the sentence by this one. It was my fault when writing it:

 

 

= Table.ReplaceValue(PreviousStepName,each [Name], each if [ID]="12345" then "ABC Kitchen (Old)" else [Name] ,Replacer.ReplaceText,{"Name"})

 

View solution in original post

4 REPLIES 4
Homaa
Frequent Visitor

Thank you but the problem here is that there are other values in the "name" column as well. So, [ID] <> "12345" is not working. the type for both column is text

mlsx4
Memorable Member
Memorable Member

@Homaa 

Then, change the sentence by this one. It was my fault when writing it:

 

 

= Table.ReplaceValue(PreviousStepName,each [Name], each if [ID]="12345" then "ABC Kitchen (Old)" else [Name] ,Replacer.ReplaceText,{"Name"})

 

Homaa
Frequent Visitor

it works. Thank you!

mlsx4
Memorable Member
Memorable Member

Hi @Homaa 

= Table.ReplaceValue(PreviousStepName,each [Name], each if [ID]<>"12345" then "ABC Kitchen" else "ABC Kitchen (Old)",Replacer.ReplaceText,{"Name"})

Be careful with the type of data for the column id too.  Because if it is number, you should compare without "" characters

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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