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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Partial Vlookup in Power Query

Hi All,

 

I would like to write a step or steps in Power Query that will do the following;

 

1. Identify if the values in the [Originating Master Name] column contain a vendor name from my "Vendors" query.

2. If the value from the [Originating Master Name] column matches a vendor name, I'd like to create a new column in my "TB Expenses - Current Month" query to pull in the vendor name from the "Vendors" query.

 

The file I attached includes a sample of my data. The goal is to change "EPAM SYSTEMS - 0000" to "EPAM SYSTEMS" by referencing the vendor list included in the "Vendor Query".

 

 

 

 

 

 

 

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

Is there a way that we can modify the code so that the step only pulls exact matches as opposed to using the Text.Contians function? Thanks again, this is very helpful.

Hi All, 

 

Following up on my last message. Is there a way that we can modify the code so that the step only pulls exact matches as opposed to using the Text.Contains function? Thanks again, this is very helpful.

try this code

= let a=List.Buffer(Table.ToRows(Vendors)) in Table.TransformColumns(#"Changed Type",{"Originating Master Name",each List.Skip(a,(x)=>Text.Upper(_)<>Text.Upper(x{1})){0}?{2}? ??_})

Syndicate_Admin
Administrator
Administrator

Is there a way that we can modify the code you wrote so that the "Final Vendor" column will be pulled based on the "Vendor (All Caps)" value that is contained in the "Originating Master Name"?

 

NOTE: I added this "Final Vendor" column manually to the Vendors tab. You won't see it in the attachment I included.

 

if the final vendor is the 3rd column then

= let a=List.Buffer(Table.ToRows(Vendors)) in Table.TransformColumns(#"Changed Type",{"Originating Master Name",each List.Skip(a,(x)=>not Text.Contains(_,x{1},Comparer.OrdinalIgnoreCase)){0}?{2}? ??_})

wdx223_Daniel
Super User
Super User

no need the upper text step

= let a=List.Buffer(Vendors[#"Vendor (All Caps)"]) in Table.TransformColumns(#"Changed Type",{"Originating Master Name",each List.Skip(a,(x)=>not Text.Contains(_,x,Comparer.OrdinalIgnoreCase)){0}? ??_})

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.