This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi everyone,
I'm trying to create a column which checks if two other columns contains some expressions. So I tried to create that column, this is how it looks like:
Column = if(AND(Text.Contains([Column1], "something"), Text.Contains([Column2], "anything"))) then "result" else "other"
But it is not working for me, and I have no idea why, and I couldn't find any solution for it.
This is the error message I got:
Expression.Error: The name 'AND' wasn't recognized. Make sure it's spelled correctly.
Anybody has any idea how to solve it/make it right?
Thanks in advance.
Solved! Go to Solution.
AND() is an Excel function. What you are looking for is just to use "and" as an operator.
Column = if Text.Contains([Column1], "something") and Text.Contains([Column2], "anything") then "result" else "other"
I am trying to write something similar but for DAX filter.
This is what I have so far but 'and' does not seem to work.
I cant seem to find what is correct operator for 'and'.
Thanks
Can someone help me please with the syntax error:
AND() is an Excel function. What you are looking for is just to use "and" as an operator.
Column = if Text.Contains([Column1], "something") and Text.Contains([Column2], "anything") then "result" else "other"
Oh, I see. Thank you very much!
Hi everyone,
I'm trying to create a column which checks the content of 2 existing columns and if column1 contains "something" and column2 contains "anything" then "result1" else "result2".
This is how it looks like: Column = if(AND(Text.Contains([Column1], "something"), Text.Contains([Column2], "anything"))) then "result" else "other"
There is no syntax error in it, but if I try to create it, it gives me this error message: "Expression.Error: The name 'AND' wasn't recognized. Make sure it's spelled correctly."
Anyone has any idea what is the problem with it?
Thanks in advance.
Where are you writing this? As dax or PQL?
Read "2 ways to add a column" in this post http://exceleratorbi.com.au/shaping-modelling-power-bi/
this task is best done in Power Query (get data). There is no and function in power query. The syntax is
= if [column1] = "something" and [column2] = "whatever" then "x" else "y"
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 30 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 62 | |
| 51 | |
| 31 | |
| 23 | |
| 23 |