Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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. 

  • Hi Anonymous ,

     

    Try changing Replacer.ReplaceText with Replacer.ReplaceValues.

     

    Pete

2 Replies

  • Hi Anonymous ,

     

    Try changing Replacer.ReplaceText with Replacer.ReplaceValues.

     

    Pete

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you!