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.
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.
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.
Another way to write OR function-
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.