Search

Search Scripts

Scripting Reference Guides

Rick W

Dax Logical Functions

Conditional evaluations and logical operations within Microsoft Power BI.

A. IF

Status = IF(Sales[Amount] > 1000, "High", "Low") 

This example evaluates the condition if the Amount in the Sales table is greater than 1000. If true, it returns "High", and if false, it returns "Low". The result will be stored in the Status column. 

B. AND

IsEligible = AND(Customer[Age] >= 18, Customer[Income] > 50000) 

This example checks if both the Age and Income columns in the Customer table satisfy specific conditions. It returns TRUE if both conditions are true; otherwise, it returns FALSE. The result will be stored in the IsEligible column. 

C. OR

HasDiscount = OR(Sales[Category] = "Electronics", Sales[Category] = "Clothing") 

This example checks if the Category column in the Sales table matches either "Electronics" or "Clothing". If at least one condition is true, it returns TRUE; otherwise, it returns FALSE. The result will be stored in the HasDiscount column.  

D. NOT

IsQualified = NOT(Applicants[Experience] < 2)
 
This example checks if the Experience column in the Applicants table is not less than 2. It reverses the logical value of the condition. If the condition is true, it returns FALSE; if the condition is false, it returns TRUE. The result will be stored in the IsQualified column. 

Previous Article DAX Statistical Functions
Next Article Dax Text Functions
Print
417