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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Simon_29
Helper II
Helper II

Change the value in a column based on a value in another column

Hello,

in one community I found a command to change the value in one column based on another column, but it doesn't work properly. Could you advise me?

The problem is as follows:
I have an ORDER_STATUS column and a load_date column. I want to change the value in the load_date column based on the value in the ORDER_STATUS column. If the ORDER_STATUS column has the value "CLAW", I want the value "NA: CLAW" to be added to the load_date column.
The function should be correct (I indicated it in the picture), but it does not do what it should.

Can you advise please? Thank you very much.

replace1.png

2 ACCEPTED SOLUTIONS
BA_Pete
Super User
Super User

Hi @Simon_29 ,

 

Change 'Replacer.ReplaceText' in your formula bar to 'Replacer.ReplaceValue'.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

FYI, the reason @BA_Pete's solution works is because Replacer.ReplaceText looks for substrings and Replacer.ReplaceValue looks at the entire contents of a cell.

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @Simon_29 ,

 

Change 'Replacer.ReplaceText' in your formula bar to 'Replacer.ReplaceValue'.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




I appreciate your advice. Everything is already working. Thank you very much

FYI, the reason @BA_Pete's solution works is because Replacer.ReplaceText looks for substrings and Replacer.ReplaceValue looks at the entire contents of a cell.

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.