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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

ReplaceValue with two conditions

Hi!
I have a table with a column "Reasons" that contains text and null values. In this table I also have "Reasons_id" column. The thing is that I want to replace null values in "Reasons" that have Reasons_id = 150.  And replace them with the text "Approved".

I tried this one but it doesn't work.
= Table.ReplaceValue(#"Removed Duplicates", each [Reasons] , each if [Reasons_id]= 150 and [Reasons] = null then "Approved" else [Reasons], Replacer.ReplaceText,{"Reasons"})

Interestengly, it displays no error but returns me a table as it was before. No changes. It didn't replace  null values with id = 150. What did I do wrong? Thank you a lot for your help in advance. 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try changing Replacer.ReplaceText with Replacer.ReplaceValues.

 

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

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try changing Replacer.ReplaceText with Replacer.ReplaceValues.

 

Pete



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

Proud to be a Datanaut!




Anonymous
Not applicable

Thank you!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors