OR

適用対象:計算列計算テーブルメジャービジュアル計算

TRUE を返すために、いずれかの引数が TRUE であるかどうかを確認します。 両方の引数が FALSE の場合、関数では FALSE が返されます。

構文

OR(<logical1>,<logical2>)  

パラメーター

用語 定義
logical_1、logical_2 テストする論理値。

戻り値

ブール値です。 2 つの引数のいずれかが TRUE の場合、値は TRUE になります。両方の引数が FALSE の場合、値は FALSE になります。

解説

  • DAX の OR 関数では、2 つの引数のみを受け入れます。 複数の式に対して OR 演算を実行する必要がある場合は、一連の計算を作成するか、さらにいいのは、OR 演算子 ( || ) を使用して、それらすべてをよりシンプルな式で結合することができます。

  • 関数では、引数を最初の TRUE 引数まで評価してから、TRUE を返します。

次の例は、OR 関数を使用して、Circle of Excellence に属する販売員を取得する方法を示しています。 Circle of Excellence では、100 万ドルを超えるツーリング バイクの売上、または 2007 年に 250 万ドルを超える売上を達成した販売員が認識されます。

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"  
   , ""  
   )  

戻り値

行ラベル 2005 2006 2007 2008 - 総計
Abbas, Syed E
Alberts, Amy E
Ansman-Wolfe, Pamela O
Blythe, Michael G Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence
Campbell, David R
Carson, Jillian Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence
Ito, Shu K
Jiang, Stephen Y
Mensa-Annan, Tete A
Mitchell, Linda C Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence
Pak, Jae B Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence
Reiter, Tsvi Michael
Saraiva, José Edvaldo Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence
Tsoflias, Lynn N
Valdez, Rachel B
Vargas, Garrett R
Varkey Chudukatil, Ranjit R Circle of Excellence
総計 Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence Circle of Excellence

論理関数