Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
mdex
Resolver I
Resolver I

Finding first word in string that matches list in separate table

Hi,

 

I have a table with a list of keywords.

mdex_0-1652349479968.png

 

What I would like to do is look at a string (description) in another table (table1) and return the Output from Keywords on the first matching Tag.

 

String "Fault with Outlook due to VPN" would return the Output "MS Outlook"

 

A simple lookup value will only match the whole string, FIND/SEARCH don't allow lookup of table values.

 

Any help is appreciated.

 

1 ACCEPTED SOLUTION
mdex
Resolver I
Resolver I

Thanks both.

 

I ended up doing this in Power Query.

 

1. Separated all words in the in the description into a list.

2. Found first word in that list that matches a tag

 

I'll checkout the answer from @Ashish_Mathur too.

 

Thanks

 

View solution in original post

3 REPLIES 3
mdex
Resolver I
Resolver I

Thanks both.

 

I ended up doing this in Power Query.

 

1. Separated all words in the in the description into a list.

2. Found first word in that list that matches a tag

 

I'll checkout the answer from @Ashish_Mathur too.

 

Thanks

 

Ashish_Mathur
Super User
Super User

Hi,

Try these calculated formulas

All matches = CONCATENATEX(FILTER(VALUES(tags),CONTAINSSTRING(Data[Remarks],Tags[Tag])),Tags[Output],", ")
First match = lookupvalue(Tags[Output],Tags[Tag],FIRSTNONBLANK(FILTER(values(Tags[tag]),SEARCH(Tags[Tag],Data[Remarks],1,0)),1))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Do you need this in DAX or in Power Query? 

 

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.