Forum Discussion
nicktayl
Helper I
9 years agoToo many arguments were passed to the AND function. The maximum argument count for the function is 2
In Access and Excel you can write "AND" or "OR" functions with unlimited conditions. Is this not the case in Power BI DAX "AND" functions? If this is a limitation in DAX, does anyone have a...
mmace1
Impactful Individual
9 years agoHi,
You can actually have unlimited AND/OR in DAX, you just have to write it a little differently.
Specifically, you have to nest all the AND/ORs above 2. It's kinda stupid, but it works.
So say in Excel you'd write:
=IF(AND(A1=1,B1=2,C1=3),"OK", "oh no")
In DAX you'd write
=IF(AND(A1=1,AND(B1=2,C1=3)),"OK","oh no")
Edit: Or actually use &&, that's far better. Or the equivalent for OR, ||
- mmace19 years ago
Impactful Individual
Well, probalby not unlimited, but I imagine as many as Excel can support.
Anyway, so you can have many AND/OR statements, you just have to keep nesting as you go...