Forum Discussion
Anonymous
5 years agoNot applicable
CASE Complex statement in DAX
Hello! 🙂 I am trying to "translate" a complex case statement in DAX. I have tried 'Switch function' and it's OK: New field = SWITCH ( TRUE (), table1[Category] = "hair-color", "LUXE"...
- 5 years ago
Anonymous , You can try like
New field = SWITCH (
TRUE (),
table1[Category] in ("hair-color","hair-care","hair-style"), "LUXE",
"Other"
)But if need to search then you need use search, check
BA_Pete
5 years agoSuper User
Hi Anonymous ,
This might work?
_newField =
SWITCH(
TRUE(),
CONTAINSSTRING(table1[Category], "Hair"), "Hair",
CONTAINSSTRING(table1[Category], "Skin"), "Skin",
...
)
Pete