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

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

Reply
smpa01
Super User
Super User

Lookup based on partial value in power query

Hi,
I have the following data

NAME ID Partial Name
SAM JONES 123 SAM
TOM CLIFF 234 TOM

If I want to bring the ID based on the partial value of I can do the following in excel and it would bring the ID based o the partial value

NAME ID Partial Name Partial Name2
SAM JONES 123 SAM *SAM*
TOM CLIFF 234 TOM *TOM*

Index(B1:B3,Match(D2,A1:A3,0))

I was wondering if Power Query has the similar capacities.

Thank you in advance.
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @smpa01,

 

If I understand you correctly, a simple DAX formula could do that.

 

I assume you have a table called "Table1" with NAME and ID column.

 

t1.PNG

 

And another table called "Table2" with Partial Name column.

 

t2.PNG

 

Then you should be able to use the formula below to create a calculate column in "Table2" to get ID from "Table1" based on the value of Partial Name. Smiley Happy

Column = 
CALCULATE (
    MAX ( Table1[ID] ),
    FILTER ( Table1, SEARCH ( Table2[Partial Name], Table1[NAME],, 0 ) > 0 )
)

c1.PNG

 

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @smpa01,

 

If I understand you correctly, a simple DAX formula could do that.

 

I assume you have a table called "Table1" with NAME and ID column.

 

t1.PNG

 

And another table called "Table2" with Partial Name column.

 

t2.PNG

 

Then you should be able to use the formula below to create a calculate column in "Table2" to get ID from "Table1" based on the value of Partial Name. Smiley Happy

Column = 
CALCULATE (
    MAX ( Table1[ID] ),
    FILTER ( Table1, SEARCH ( Table2[Partial Name], Table1[NAME],, 0 ) > 0 )
)

c1.PNG

 

Regards

@v-ljerr-msftthanks for the solution. Is there a way to achieve this in Power Query by any chance - searching a column of Partial Text Strings in another list of column containing Text Strings.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
smpa01
Super User
Super User

NAME -------------ID----------Partial Name
SAM JONES----123--------SAM
TOM CLIFF------234--------TOM

NAME------------ID---Partial Name------Partial Name2
SAM JONES-------123------SAM-------*SAM*
TOM CLIFF---------234-------TOM-------*TOM*
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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 Kudoed Authors