Home » DAX » OR (||) DAX Function – Logical Function

OR (||) DAX Function – Logical Function

OR DAX functions

Checks whether one of the arguments is TRUE to return TRUE. The function returns FALSE if both arguments are FALSE. Its comes under Logical DAX functions category.

Syntax:

OR(logical1, logical2)

Parameters

logical1, logical2 – The logical values you want to test.

Download the sample Dataset from below link-




Let’s understand with an example:

See the below sample data, here we have Category, sub category and Sales data.

Sample Data

Sample Data

Now create one measure for OR Dax function-

SUM with OR =

CALCULATE(
SUM('Global-Superstore'[Sales]),
FILTER ('Global-Superstore',
OR (
'Global-Superstore'[Category] = "Furniture",
'Global-Superstore'[Sub-Category]="Art"
)
)
)

Now drag measure to Table and in Card visual, It will return SUM of sales whether one condition true.

DAX-OR function

DAX-OR function




Another way to write OR function-

Instead of OR  you can use || sign, let’s have a look in below DAX code.

SUM with Or= CALCULATE(
SUM('Global-Superstore'[Sales]),
FILTER (
'Global-Superstore',
'Global-Superstore'[Category] = "Furniture" ||
'Global-Superstore'[Sub-Category]="Art"
) )

Refer more DAX functions: DAX functions

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our Contact form , we will revert to you asap.

Leave a Reply