OpenBI Docs Buy

OR

TRUE when either of two conditions is TRUE (the || operator).

Group: Logical. Compatible with DAX.

Syntax

OR ( <logical1>, <logical2> )
ParameterTypeDescription
logical1BooleanThe first condition.
logical2BooleanThe second condition.

Returns

Boolean. TRUE when at least one condition holds, FALSE when neither does.

Remarks

  • It takes exactly two conditions. For more, chain the || operator, A || B || C.
  • A blank condition counts as FALSE, and a number as TRUE unless it is 0. Text is an error.
  • When the first condition is TRUE, the second is not looked at: OR ( TRUE (), "a" ) is TRUE.
  • For one column against a list of values, IN is shorter: Products[Product] IN { "Pils", "IPA" }.

Examples

All four pairs

EVALUATE
VAR Pairs =
    DATATABLE (
        "A", BOOLEAN, "B", BOOLEAN,
        { { TRUE, TRUE }, { TRUE, FALSE }, { FALSE, TRUE }, { FALSE, FALSE } }
    )
RETURN
    ADDCOLUMNS ( Pairs, "OR", OR ( [A], [B] ), "||", [A] || [B] )
ABOR||
TRUETRUETRUETRUE
TRUEFALSETRUETRUE
FALSETRUETRUETRUE
FALSEFALSEFALSEFALSE

Liters of two products

EVALUATE
ROW (
    "Pils or IPA",
        CALCULATE (
            [Liters sold],
            FILTER ( ALL ( Products[Product] ), OR ( Products[Product] = "Pils", Products[Product] = "IPA" ) )
        )
)
Pils or IPA
1336210

AND, NOT, IF, FILTER, CONTAINSROW.

Last updated · OpenBI Studio 0.3.74