Excel DAX - Logical Operators



You can use DAX logical operators to combine expressions that evaluate to a logical or Boolean value (TRUE or FALSE), to produce a single result that is logical (TRUE or FALSE).

Logical Operator Logical Operation Evaluation
! NOT It is a unary operator. This means it takes only one operand. The result is −
  • TRUE if the operand evaluates to FALSE.
  • FALSE if the operand evaluates to TRUE.
&& AND TRUE only if both the expressions are TRUE. Otherwise, FALSE.
|| OR FALSE only if both the expressions are FALSE. Otherwise, TRUE.

Examples

  • ! (1 = 1) results in FALSE, because 1 = 1 is TRUE.
  • ! (1 <> 1) results in TRUE, because 1 <> 1 is FALSE.
  • (1 = 1) && (5>4) results in TRUE, because both are TRUE.
  • (5>4) && (5 = 4) results in FALSE, because 5 = 4 is FALSE.
  • (1 = 1) || (5 = 4) results in TRUE, because 1 = 1 is TRUE.
  • (2 = 4) || (5 = 4) results in FALSE, because both are FALSE.
excel_dax_operators.htm
Advertisements