Forum Discussion
Match Serval Text in Measure
- Anonymous4 years ago
Hi KH_Mike ,
Try
Measure= SWITCH ( MAX ( 'Data'[Country] ), "USA", "AMR", "CANADA", "AMR", MAX ( 'Data'[Country] ) )or
Measure= IF ( MAX ( 'Data'[Country] ) = "USA" || MAX ( 'Data'[Country] ) = "CANADA", "AMR", MAX ( 'Data'[Country] ) )The MAX function is equivalent to getting the value of the current row, and the MIN function can also achieve the same effect.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi amitchandak ,
I want to know if there is any function like Switch in Excel can make it formula short. Also, if I only input "Data[Country]" at the end. It seems can't work correctly.
Hi KH_Mike ,
Try
Measure=
SWITCH (
MAX ( 'Data'[Country] ),
"USA", "AMR",
"CANADA", "AMR",
MAX ( 'Data'[Country] )
)
or
Measure=
IF (
MAX ( 'Data'[Country] ) = "USA"
|| MAX ( 'Data'[Country] ) = "CANADA",
"AMR",
MAX ( 'Data'[Country] )
)
The MAX function is equivalent to getting the value of the current row, and the MIN function can also achieve the same effect.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- KH_Mike4 years agoHelper III
Hi Anonymous,
That exactly what I need. Thank you.