OR Function (DAX)

 

Checks whether one of the arguments is TRUE to return TRUE. The function returns FALSE if both arguments are FALSE.

OR(<logical1>,<logical2>)  

Parameters

TermDefinition
logical_1, logical_2The logical values you want to test.

A Boolean value. The value is TRUE if any of the two arguments is TRUE; the value is FALSE if both the arguments are FALSE.

The OR function in DAX accepts only two (2) arguments. If you need to perform an OR operation on multiple expressions, you can create a series of calculations or, better, use the OR operator (||) to join all of them in a simpler expression.

The function evaluates the arguments until the first TRUE argument, then returns TRUE.

The following example shows how to use the OR function to obtain the sales people that belong to the Circle of Excellence. The Circle of Excellence recognizes those who have achieved more than a million dollars in Touring Bikes sales or sales of over two and a half million dollars in 2007.

SalesPersonFlagTrue
OR functionColumn Labels
Row Labels2005200620072008Grand Total
Abbas, Syed E
Alberts, Amy E
Ansman-Wolfe, Pamela O
Blythe, Michael GCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of Excellence
Campbell, David R
Carson, JillianCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of Excellence
Ito, Shu K
Jiang, Stephen Y
Mensa-Annan, Tete A
Mitchell, Linda CCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of Excellence
Pak, Jae BCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of Excellence
Reiter, Tsvi Michael
Saraiva, José EdvaldoCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of Excellence
Tsoflias, Lynn N
Valdez, Rachel B
Vargas, Garrett R
Varkey Chudukatil, Ranjit RCircle of Excellence
Grand TotalCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of ExcellenceCircle of Excellence
IF(   OR(   CALCULATE(SUM('ResellerSales_USD'[SalesAmount_USD]), 'ProductSubcategory'[ProductSubcategoryName]="Touring Bikes") > 1000000  
         ,   CALCULATE(SUM('ResellerSales_USD'[SalesAmount_USD]), 'DateTime'[CalendarYear]=2007) > 2500000  
         )  
   , "Circle of Excellence"  
   , ""  
   )  

Logical Functions (DAX)

Community Additions

Show: