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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.