Forum Discussion
jereaallikko
Helper III
5 years agoDAX with Multiple IF Contains Statements
Hi all, I am trying to figure out a simple DAX with multiple conditions: If [Column] contains "This1" then "That1" elseif [Column] contains "This2" then "That2" elseif [Column] contains "This...
VahidDM
Super User
5 years ago
Try this measure :
Country =
VAR _A =
MAX ( 'Table'[Name] )
RETURN
IF (
LEFT ( _A, 3 ) = "FIN",
"Finland",
IF (
LEFT ( _A, 3 ) = "GER",
"Germany",
IF ( LEFT ( _A, 3 ) = "RUS", "Russia", BLANK () )
)
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
jereaallikko
Helper III
5 years agoThis worked well! Thanks a lot.
Is there a way to apply similar solution to DAX column? This works in a DAX measure but if I want to use this as a slicer, it must be as a DAX column since DAX measures cannot be used as a slicer.