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
Anonymous
Not applicable

replace the value when another column condition is true in power query editor

I have to replace the only one value i.e. Canada in test column when InventoryDeviceLocation = "CA - Winnipeg, MB - 99 Commerce Dr" 

 

renamed the columns: from Assigned user - Corporate structure - 2nd level to test

test is column name instead of Assigned user - Corporate structure - 2nd level  column

 

im using below both the codes but not replacing the value.. could you please help me on this asap

 

Table.ReplaceValue(#"Renamed columns",each [test],each if [InventoryDeviceLocation] = "CA - Winnipeg, MB - 99 Commerce Dr" then "Canada" else [test],Replacer.ReplaceValue,{"test"})

 

Table.ReplaceValue(#"Renamed columns",each [test],each if [InventoryDeviceLocation] = "CA - Winnipeg, MB - 99 Commerce Dr" then "Canada" else [test],Replacer.ReplaceText,{"test"})

 

RajuM_0-1657769063862.png

 

1 ACCEPTED SOLUTION
PC2790
Community Champion
Community Champion

Hey @Anonymous ,

 

Your code looks correct.

Are you getting any error?

Can you show the screenshot of the next step where you are replacing the value in test column?

Also, I am assuming that you copied the value from the [InventoryDeviceLocation] column in your code as even a single space could make a difference

View solution in original post

1 REPLY 1
PC2790
Community Champion
Community Champion

Hey @Anonymous ,

 

Your code looks correct.

Are you getting any error?

Can you show the screenshot of the next step where you are replacing the value in test column?

Also, I am assuming that you copied the value from the [InventoryDeviceLocation] column in your code as even a single space could make a difference

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