Forum Discussion
lf963
4 years agoFrequent Visitor
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, ...
- 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"})
ImkeF
4 years agoCommunity Champion
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"})
lf963
4 years agoFrequent Visitor
This works!!! Thank you!!!