OR DAX Function (Logical)
Returns TRUE if any of the arguments are TRUE, and returns FALSE if all arguments are FALSE.
Syntax
Parameter | Attributes | Description |
---|---|---|
Logical1 |
The logical values you want to test. |
|
Logical2 |
The logical values you want to test. |
Return values
The value is TRUE if any of the two arguments is TRUE; the value is FALSE if both the arguments are FALSE.
Remarks
The OR function accepts only two arguments. Consider using the operator || to avoid multiple nested calls in case there are three or more conditions to evaluate in a logical OR.
» 2 related functions
Examples
-- TRUE and FALSE are the two constant values of True and False (1, 0 ) -- AND performs the logical AND between two conditions -- OR performs the logical OR between two conditions -- NOT performs logical negation EVALUATE { ( "FALSE", FALSE ), ( "FALSE()", FALSE() ), ( "TRUE", TRUE ), ( "TRUE()", TRUE() ), ( "AND ( TRUE, FALSE )", AND ( TRUE, FALSE ) ), ( "OR ( TRUE, FALSE )", OR ( TRUE, FALSE ) ), ( "NOT ( TRUE )", NOT ( TRUE ) ), ( "NOT ( FALSE )", NOT ( FALSE ) ) }
Value1 | Value2 |
---|---|
FALSE | false |
FALSE() | false |
TRUE | true |
TRUE() | true |
AND ( TRUE, FALSE ) | false |
OR ( TRUE, FALSE ) | true |
NOT ( TRUE ) | false |
NOT ( FALSE ) | true |
-- The AND function can be replaced with the && operator -- The OR function can be replaced with the || operator EVALUATE { ( "AND ( TRUE, FALSE )", AND ( TRUE, FALSE ) ), ( "TRUE && FALSE", TRUE && FALSE ), ( "OR ( TRUE, FALSE )", OR ( TRUE, FALSE ) ), ( "TRUE || FALSE", TRUE || FALSE ) }
Value1 | Value2 |
---|---|
AND ( TRUE, FALSE ) | false |
TRUE && FALSE | false |
OR ( TRUE, FALSE ) | true |
TRUE || FALSE | true |
-- Operators are more convenient when you need to combine -- more than two conditions. EVALUATE VAR A = TRUE VAR B = FALSE VAR C = TRUE RETURN { ( "Using OR", OR ( A, OR ( B, C ) ) ), ( "Using ||", A|| B || C ) }
Value1 | Value2 |
---|---|
Using OR | true |
Using || | true |
Related articles
Learn more about OR in the following articles:
-
Using OR conditions between slicers in DAX
This article describes how to implement in DAX a logical OR condition between the selection of two slicers of a Power BI report or of a PivotTable in Excel. By default, when relying on more than one slicer they are considered in an AND condition. » Read more
-
Using tuple syntax in DAX expressions
This article describes the use of the tuple syntax in DAX expressions to simplify comparisons involving two or more columns. » Read more
Related functions
Other related functions are:
Last update: Nov 7, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/or-function-dax