Forum Discussion
Anonymous
4 years agoNot applicable
using if(text.Contains) for multiple conditions in Power Query M
Hi there I am trying to make a custom column by using an if() statement to pass an existing column through more than one text.Contains condition, and then return a string. I have tried the be...
- 4 years ago
Anonymous
The correct syntax in Power Query would be as follows. Pay very close attention to the capitalisation as M code is entirely case-sensitive:
if Text.Contains([Product], "AB") and Text.Contains([Product], "CD") then "EF" else //your escape value goes here, like null or "Error" or similarPete
BA_Pete
4 years agoSuper User
Anonymous
The correct syntax in Power Query would be as follows. Pay very close attention to the capitalisation as M code is entirely case-sensitive:
if Text.Contains([Product], "AB") and Text.Contains([Product], "CD")
then "EF"
else //your escape value goes here, like null or "Error" or similar
Pete