共用方式為


OR 函數

若要傳回 TRUE,請檢查其中一個引數是否為 TRUE。 若兩個引數都是 FALSE,此函數會傳回 FALSE。

語法

OR(<logical1>,<logical2>)

參數

詞彙

定義

logical_1, logical_2

您想要測試的邏輯值。

傳回值

布林值。 如果任一個引數為 TRUE,此值為 TRUE;如果兩個引數都是 FALSE,則此值為 FALSE。

備註

DAX 中的 OR 函數只接受兩個 (2) 引數。 如果您需要針對多個運算式執行 OR 運算,可以建立一連串的計算,或 (建議) 使用 OR 運算子 (||) 將所有計算聯結成更簡化的單一運算式。

此函數會評估引數,直到第一個 TRUE 引數出現,然後傳回 TRUE。

範例

下列範例示範如何使用 OR 函數來取得屬於 Circle of Excellence 的銷售人員。 Circle of Excellence 辨識為在 2007 年已達成 Touring Bikes 的一百萬銷售金額或是銷售金額超過兩百五十萬的人。

SalesPersonFlag

True

 

 

 

 

 

 

 

 

 

 

 

 

OR 函數

資料行標籤

 

 

 

 

 

資料列標籤

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

Grand Total

Circle of Excellence

Circle of Excellence

Circle of Excellence

Circle of Excellence

Circle of Excellence

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

請參閱

其他資源

邏輯函數 (DAX)