Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
23 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
42 | |
39 | |
19 | |
19 |