The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I have a column with cells containing a lot of text.
I would like to create a column which looks for a certain word and return a specific value.
1.
For instance if I was to look for Apple -> return 'Yes' or 'No'
Can I make the code look for *app*' or does it need to be fully matching?
I would like to have to return entries like 'apple-like' for instance, or or 'apples'
I hope this makes sense, right now I'm using the 'add a conditional column' in the query, which is fine, but not taking all possibities into account.
Thanks
Kristoffer
Solved! Go to Solution.
Hello there @KristofferAJ ! You can use the following:
Find word =
IF ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), "Yes", "No" )
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
Hi, this is great and does the job! - let's say that I want it to look for multiple words, like orange also? can that be built in?
Find word =
IF ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), "Yes", "No" )
OR
( CONTAINSSTRING ( 'Your_Table'[Your_column], "*oran*" ), "Yes", "No"
Hello there @KristofferAJ ! You can simply do:
Find word =
IF (
OR (
CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ),
CONTAINSSTRING ( 'Your_Table'[Your_column], "*oran*" )
),
"Yes",
"No"
)
For additional help, please @ me in your reply!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
Hello there @KristofferAJ ! You can use the following:
Find word =
IF ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), "Yes", "No" )
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes