OpenBI Docs Buy

AND

TRUE when both of two conditions are TRUE (the && operator).

Group: Logical. Compatible with DAX.

Syntax

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

Returns

Boolean. TRUE when both conditions hold, FALSE otherwise.

Remarks

  • It takes exactly two conditions. For three or more, chain the && operator, A && B && C, or put one AND inside another.
  • A blank condition counts as FALSE, and a number as TRUE unless it is 0. Text is an error.
  • When the first condition is FALSE, the second is not looked at: AND ( FALSE (), "a" ) is FALSE, although "a" cannot be a condition.

Examples

All four pairs

EVALUATE
VAR Pairs =
    DATATABLE (
        "A", BOOLEAN, "B", BOOLEAN,
        { { TRUE, TRUE }, { TRUE, FALSE }, { FALSE, TRUE }, { FALSE, FALSE } }
    )
RETURN
    ADDCOLUMNS ( Pairs, "AND", AND ( [A], [B] ), "&&", [A] && [B] )
ABAND&&
TRUETRUETRUETRUE
TRUEFALSEFALSEFALSE
FALSETRUEFALSEFALSE
FALSEFALSEFALSEFALSE

Big Pils months

Sales rows of Pils with more than 1,000 liters; the && form gives the same count.

EVALUATE
ROW (
    "AND", COUNTROWS ( FILTER ( Sales, AND ( Sales[Product] = "Pils", Sales[Liters] > 1000 ) ) ),
    "&&", COUNTROWS ( FILTER ( Sales, Sales[Product] = "Pils" && Sales[Liters] > 1000 ) )
)
AND&&
252252

OR, NOT, IF, FILTER, CALCULATE.

Last updated · OpenBI Studio 0.3.74