Forum Discussion

lf963's avatar
lf963
Frequent Visitor
4 years ago
Solved

Replace null with if statement

Hello,   I have a table shown in the following screenshot:   What I want to do is: if column Color is Red AND column Like is null, replace the null in the Like column with "N". Therefore, ...
  • ImkeF's avatar
    4 years ago

    OK, now the nulls are real nulls (as they are in italics now).
    So you have to go back to without quotes and use a different replacer function (ReplaceValue instead of ReplaceText) like so:

    Table.ReplaceValue(#"Replaced Value", each [Like], each if [Color] = "Red" and [Like] = null then "N" else [Like],Replacer.ReplaceValue,{"Like"})