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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Search for text from one table column in another table column and return a different column if found

I have seen some questions similar to this and I have tried some but they don't return what I want.

 

I have one table that has a column with a program name. I have a second table that has a text field that contains one or more program names (separated by commas). I want for each record in table #1 to add a new column that if I can find the same program name in table #2 and to make this new column contain the value of a totally different column in table #2. 

 

These tables both have a lot of other columns in them but I am only showing the ones I want for this task. The tables are not linked/associated to each other.

 

Table #1

Program Name

 

Table #2

Assigned programs - one column with 1 or more program names in it each separated by a comma

LOB

 

The new column should be the first found result.

 

Example data/result:

Table #1

Program NameFound LOB (new column)
GoogleLOB1
NetflixLOB2
FacebookLOB1
TwitterNone

 

Table #2 (the same LOB could be assigned to more than one combination)

Assigned ProgramsLOB
Google, FacebookLOB1
FacebookLOB3
Netflix, GoogleLOB2
Netflix, FacebookLOB2

 

I am not sure if this should be done in DAX or the Power Query (transformation) - not sure if it matters or which is better. I have tried some examples I have seen for both ways but those examples didn't fully work to bring back a value from a totally different column (some returned the searched word, or starting position, etc.). I tried the fuzzy search with merged queries but that didn't bring back just the LOB column value but inserted a table with a new column in it which isn't what I would like. I need this new column to be available for vizualizations with other columns from Table #1 (not shown). 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , A new column in table 1

 

maxx(filter( Table2, search(Table1[Program Name], Table2[Assigned Program],,0) >0 ),Table2[LOB])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , A new column in table 1

 

maxx(filter( Table2, search(Table1[Program Name], Table2[Assigned Program],,0) >0 ),Table2[LOB])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks!  If there are no records found by the Filer, will it give an error or is there a way to make it put 'None' in?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors