Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello,
Fairly new to Power BI so excuse any lack in terminology or decorum.
I have a data set that has a column where the values contain (example) ...."-WP"....
I created a new column named contains WP and put the following as the function...
= If(ISERROR(SEARCH("-WP",'TABLE_NAME'[COLUMN_IN_TABLE])),"No","Yes")This worked like a charm for what I was trying to do.
Solved! Go to Solution.
Just to wrap this up and call this solved, here is what I did...
= CONTAINSSTRING('MY_TABLE'[MY_COLUMN],"AK??-D*")
This gave me the True/False values I needed in the new column.
Hi @Anonymous ,
Try SWITCH(
TRUE(),
[MyMeasure]<1,expr1,
[MyMeasure]<2,expr2,
[MyMeasure]<3,expr3,
…)
Works great for a lot of values such as you have, or you can make a {list} and use IN ---'Product'[Color] IN { "Red", "Blue", "Black" }
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Nathaniel,
Thanks for the help but I am afraid I am going to need a little extra. I have not worked with SWITCH function very much and am sorry to say I am not grasping it.
Here is an example of what I tried to do to solve my problem, unfortunately it did not work...
= If(Or(Left('MY_TABLE'[MY_COLUMN],6)="AK31-D",TRUE()),
If(Or(Left('MY_TABLE'[MY_COLUMN],6)="AK32-D",TRUE()),
If(Left('MY_TABLE'[MY_COLUMN],6)="AK33-D",TRUE(),FALSE())))
An example of the data in the column would be "AK31-D01-*****-****"
I need to be able to apply a return value of either Yes/No or TRUE/FALSE if anywhere in the string exists -D01 or D-02 or D-03 etc... up to and including -D17.
I feel like I somewhat understand the concept of SWITCH but, I am not quite understanding the <1 <2 etc part of it.
Just to wrap this up and call this solved, here is what I did...
= CONTAINSSTRING('MY_TABLE'[MY_COLUMN],"AK??-D*")
This gave me the True/False values I needed in the new column.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |