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 代表这样一批人:他们的 Touring Bikes 销售额超过了 100 万美元,或者他们在 2003 年内的销售额超过 250 万美元。

SalesPersonFlag

True

OR 函数

列标签

行标签

2001

2002

2003

2004

总计

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

IF(   OR(   CALCULATE(SUM('ResellerSales_USD'[SalesAmount_USD]), 'ProductSubcategory'[ProductSubcategoryName]="Touring Bikes") > 1000000
         ,   CALCULATE(SUM('ResellerSales_USD'[SalesAmount_USD]), 'DateTime'[CalendarYear]=2003) > 2500000
         )
   , "Circle of Excellence"
   , ""
   )

results matching ""

    No results matching ""