Forum Discussion
Calculated column based on two other columns
- 6 years ago
Hey, i'm new to the forum, so forgive if the answer is wrong 😅
I've had this error as well when trying to add a condition. If memory serves, replace & by "and"
Like the following :
if Text.Contains([COLUMN1], "A") and Text.Contains([COLUMN2], "B") then 1 else 0
Edit : Just to further explain, the "&" in M language serves as a concatenate function, and not like an "AND" function. Since Power Query uses M language, and PBI uses DAX, you might mix them up.
Hey, i'm new to the forum, so forgive if the answer is wrong 😅
I've had this error as well when trying to add a condition. If memory serves, replace & by "and"
Like the following :
if Text.Contains([COLUMN1], "A") and Text.Contains([COLUMN2], "B") then 1 else 0
Edit : Just to further explain, the "&" in M language serves as a concatenate function, and not like an "AND" function. Since Power Query uses M language, and PBI uses DAX, you might mix them up.
Thank you SO much! That fixed it.