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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
crossover
Advocate I
Advocate I

Merging wildcard data between two tables

Hello! I have a data merge challange that I'm looking to solve with PowerQuery. Objective is to get data from Excel and return there too (rather than Power BI), but expecting techniques to be the same. I have Table1 full of comments which may and may not include references to products in Table2 (on the right).

 

I'm looking to link each Table1 comment to a product from Table2, but not really sure how to accomplish this. I have used the help of INDEX + wildcard MATCH formula in Excel to create a link that I could use in order to merge tables in PowerQuery, however although functional the clear limitation with this approach is only being able to link the first match.  

 

crossover_0-1632261253059.png

 

Eventually I'm looking at something like this as a returned result. It's just a simple demo dataset, there are many more products to join, so just hand picking some strings for "split column" + merge table functionality doesn't seem viable. Just realizing my demo dataset lacks an example of a Table1.Comment not having any match in the Table2.product section, but that can also be the case.

Any suggestions are highly appreciated!

 

crossover_1-1632261948839.png

 

 

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @crossover 

I believe a combination of search and sumproduct (possibly with array formulae) would do the job in Excel.

In any case, here is a possible solution in PQ. The "#Added custom" step is the relevant one. See it all at work in the attached file.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUSpKTVFILCjISS1WUIrViVYyAoqlVhSk5hVnlqUqFKQmFhWDxY2B4skZqUVFlQpJOfnFxfm5SrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, Comment = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Id", Int64.Type}, {"Comment", type text}}),

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Sum(Table.SelectRows(ProductT, (inner)=> Text.Contains([Comment], inner[Product] ))[Price]), Int64.Type)
in
    #"Added Custom"

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.