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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Ela7
New Member

Repleace values based on other table

Hi Team,

 

I hope you can help me with my problem. I have searched for it but coldn't find perticular answer. 

 

I have a table with circa 30 positions where user name was changed from User Name 1 to User Name 2 and I have few reports where is needed to repleace the value from User Name 1 to User Name 2, when the User Name 1 is visible in other table in perticular column (Reviewer) and change it to User Name B but when the user name is else, then leave it as it is.

 

I don't want to add any other column and also write 30 positions to replease value but is needed for this to work also when to the first tabel will be added new position. 

 

User Name 1User Name 2
Susanne MarsSusanne Smith
Kathrin KosKathrin Kosinska

 

Report Table

 

Reviewer
Susanne Mars
Kathrin Kos
Kathrin Kosinska
John Miller
Susanne Smith
Thomas Shelby

 


Many thanks in advance!

5 REPLIES 5
Anonymous
Not applicable

Hi @Ela7 ,

 

Another approach is that using 'Merge Queries' in Power Query.

vstephenmsft_0-1704358860334.png

Expand it.

vstephenmsft_1-1704358877722.png

Add a custom column.

vstephenmsft_2-1704358967977.png

Then you can remove the original name column and the User Name 2 column to keep the New Name column.

vstephenmsft_3-1704358996048.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Ela7
New Member

I am really sorry but I am stack:

 

Ela7_0-1701786473511.png

 

slorin
Super User
Super User

= Table.ReplaceValue(
#"TAT A1",
each [Reviewer],
each #"KN Previous Name List"{[User Name1=[Reviewer]]}[User Name2],
(row, old, new) => try new otherwise old,
{"Reviewer"} )

 Stéphane

Ela7
New Member

Hi Slorin,

thank you very match for you fast assistance.

 

Unfortunately I must be doing something wrong. I have two separate sources with those tables (names change -> KN Previous Name List and reviews -> TAT A1).

 

With the source should I refere on this query?

 

= Table.ReplaceValue(#"TAT A1",each [Reviewer],each #"KN Previous Name List" {[User Name1=[Reviewer]]} [User Name2],[User Name2],{"Reviewer"} )

 

Many thanks!

slorin
Super User
Super User

Hi,

= Table.ReplaceValue(
Source,
each [Reviewer],
each User_Name{[User Name 1=[Reviewer]]}[User Name 2],
(row, old, new) => try new otherwise old,
{"Reviewer"}
)

Stéphane 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors