AND is a DAX function that checks whether all arguments are TRUE and returns TRUE only if all arguments are TRUE.
Syntax
AND(
Logical1,
Logical2
)
Argument
Properties
Description
Logical1
The logical values you want to test.
Logical2
The logical values you want to test.
Return Values
Returns true or false depending on the combination of values that you test.
Remarks
The AND function in DAX accepts only two (2) arguments. If you need to perform an AND operation on multiple expressions, you can create a series of calculations or, better, use the AND operator (&&) to join all of them in a simpler expression.
Example 1
The following formula shows the syntax of the AND function.
= IF(AND(10 > 9, -10 < -1), "All true", "One or more false"
Because both conditions, passed as arguments, to the AND function are true, the formula returns “All True”.
Example 2
The following sample uses the AND function with nested formulas to compare two sets of calculations at the same time. For each product category, the formula determines if the current year sales and previous year sales of the Internet channel are larger than the Reseller channel for the same periods. If both conditions are true, for each category the formula returns the value, “Internet hit”.