Need help with Power Query Joins

Milperty

New Member
Joined
Feb 15, 2020
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

I am using power query to join two tables using left outer join. The problem is I am having 2 columns in one table to join or lookup for one column in another table which is not allowing in power query.
I have sample data here. Please help me with this.

The thing I am trying to achieve lookup up the values present in the column 1 and 2 in Table 1 in the Column-2 in Table 2. The approach I am following might not be perfect. I appreciate if someone can help with this or can suggest any better approach using power query or powerpivot dax. Thank you!


1586572136896.png
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
anyway, adapt this

Column1Column2Column1Result
RedGreenRedRed,Green
YellowGreenGreenGreen
BluePinkBlueBlue

Rich (BB code):
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="TableB"]}[Content],
    Expand = Table.ExpandTableColumn(Table.AddColumn(Source, "Custom", each TableA), "Custom", {"Column1", "Column2"}, {"Column1.1", "Column2"}),
    CC = Table.AddColumn(Table.Distinct(Expand, {"Column1"}), "Custom", each if [Column1] = [Column1.1] then [Column2] else null),
    TSC = Table.SelectColumns(Table.AddColumn(CC, "Result", each Text.Combine({[Column1], [Custom]}, ","), type text),{"Result"})
in
    TSC
imo, enough to change colours to your data
all is done with PQ Editor (nothing manual) ?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,796
Messages
6,174,657
Members
452,575
Latest member
Fstick546

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top