The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
Im trying to create a custom column that populates a certain value based on multiple criteria (values in other columns). I want it to populate the word "New Case" if the "status column" doesnt equal "Return" AND the value column equals HIGH and the state is not one of 5 states. I tried the formula below and it isnt working. any help would be appreciated
Switch(
TREU(),
Table name[Status column]<>"Return" && Table name[value column] = " HIGH" && Table name[Status column] ="NY" || Table name[Status column] ="CA" || Table name[Status column] ="NJ" || Table name[Status column] ="MD" || Table name[Status column] ="TX","Normal","New Case")
Solved! Go to Solution.
IF( Table name[Status column]<>"Return" && Table name[value column] = " HIGH" && NOT(Table name[Status column] in {"NY", "CA", "NJ", "MD", "TX"}) ,"Normal","New Case")
OR
IF(Table name[Status column]<>"Return" && Table name[value column] = " HIGH" && (Table name[Status column] ="NY" || Table name[Status column] ="CA" || Table name[Status column] ="NJ" || Table name[Status column] ="MD" || Table name[Status column] ="TX"),"Normal","New Case")
No need for the switch statement if there's only 2 outcomes.
You can rewrite the Status parts with the in operator to improve readability - read more here: https://www.sqlbi.com/articles/the-in-operator-in-dax/
Or just surround the whole thing with a brackets so that they are evaluated as a group
IF( Table name[Status column]<>"Return" && Table name[value column] = " HIGH" && NOT(Table name[Status column] in {"NY", "CA", "NJ", "MD", "TX"}) ,"Normal","New Case")
OR
IF(Table name[Status column]<>"Return" && Table name[value column] = " HIGH" && (Table name[Status column] ="NY" || Table name[Status column] ="CA" || Table name[Status column] ="NJ" || Table name[Status column] ="MD" || Table name[Status column] ="TX"),"Normal","New Case")
No need for the switch statement if there's only 2 outcomes.
You can rewrite the Status parts with the in operator to improve readability - read more here: https://www.sqlbi.com/articles/the-in-operator-in-dax/
Or just surround the whole thing with a brackets so that they are evaluated as a group
User | Count |
---|---|
86 | |
84 | |
36 | |
34 | |
30 |
User | Count |
---|---|
92 | |
79 | |
66 | |
55 | |
52 |