Forum Discussion
jessenewold
4 years agoFrequent Visitor
Dax using IF and Contains
Hello, I've created the below to replace the name of the terminal ID i.e. CAD01-2006 with Dispatch etc. I have hundreds of terminals. I want to be able to find all of the terminals that have "we...
- 4 years ago
You can try this approach:
Measure = IF ( CONTAINSSTRING ( SELECTEDVALUE ( T4[TERMINAL ID] ), "$" ) = TRUE (), "MOBILE", SELECTEDVALUE ( T4[TERMINAL ID] ) )If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
jessenewold
4 years agoFrequent Visitor
I want to find all terminal ID's that have $ in the name and name them "Mobile" in the Created Terminal Group column. Final all termianl ID's that have ABC in the name and name them "Center1" in the Created Terminal Group column.
Thank you.
| TERMINAL ID | CREATED TERMINAL GROUP |
| $1 | MOBILE |
| $3 | MOBILE |
| $5 | MOBILE |
| $6 | MOBILE |
| ABCpc150-037 | CENTER1 |
| ABCpc150-038 | CENTER1 |
| ABCpc150-039 | CENTER1 |
| ABCpc150-040 | CENTER1 |
| ABCpc150-041 | CENTER1 |
| ABCpc150-042 | CENTER1 |
ERD
Community Champion
4 years agoYou can try this approach:
Measure =
IF (
CONTAINSSTRING ( SELECTEDVALUE ( T4[TERMINAL ID] ), "$" ) = TRUE (),
"MOBILE",
SELECTEDVALUE ( T4[TERMINAL ID] )
)If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
- jessenewold4 years agoFrequent Visitor
Thank you so very much - this is exactly what I was looking for.