Downloads
DAXLogicalBeginner

OR

Returns TRUE when at least one of two conditions is true.

Syntax
OR(<logical1>, <logical2>)

Returns: TRUE or FALSE (a scalar).

What it does

OR combines two tests and returns TRUE when at least one of them is true. Use it to flag items that meet either of two concerns, such as "missing a tax ID or missing a contact." Inside FILTER and CALCULATE, the || operator is commonly used for the same purpose.

Syntax and arguments

OR takes exactly two tests. To combine more, nest them or use ||.

Example

The vendor master clean-up needs a list of vendors that cannot be paid cleanly: those without a tax ID, or with no bank details.

Vendor Needs Review =
IF(
    OR(
        ISBLANK(Vendors[TaxID]),
        ISBLANK(Vendors[BankAccount])
    ),
    1,
    0
)

A vendor with either field missing gets a 1. The count of flagged vendors goes on the data quality dashboard, and the list is sent to the AP team.

Example: a second, different use

Flag a sales line that either lost money or has a large discount, for a margin review:

Review Lines =
CALCULATE(
    COUNTROWS(Sales),
    FILTER(
        Sales,
        OR(
            Sales[SalesAmount] < Sales[TotalCost],
            Sales[DiscountAmount] > 500
        )
    )
)

FILTER keeps rows that meet either condition, and CALCULATE counts them. A line that meets both is counted once.

Things to watch

In business terms

OR is used for review lists and exception reports: an expense claim with no receipt or no approval, an invoice that is either duplicated or missing a PO, an account that is either overdrawn or inactive. Each condition on its own is worth a look.

Related functions

All DAX functions · View as Markdown · DAX fundamentals