Combing two Data list together

tqn626

New Member
Joined
Jul 1, 2013
Messages
49
I'm trying to merge two tables together. One is a customer list and another is a product list. I want to combine the two and expand the customer list with the product list. How would I do this in power query.

Customer List
CustomerProduct List
Customer1Food
Customer 2Consumer

<tbody>
</tbody>

Product List
Product ListProduct
Food

<tbody>
</tbody>
Product 1
Food

<tbody>
</tbody>
Product 2
Consumer

<tbody>
</tbody>
Product 3
Consumer

<tbody>
</tbody>
Product 4
Consumer

<tbody>
</tbody>
Product 5
Consumer

<tbody>
</tbody>
Product 6

<tbody>
</tbody>

Result

CustomerProduct ListProduct
Customer1FoodProduct 1
Customer1FoodProduct 2
Customer 2ConsumerProduct 3
Customer 2ConsumerProduct 4
Customer 2ConsumerProduct 5
Customer 2ConsumerProduct 6

<tbody>
</tbody>
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I'm not familar with power query: I assume it will be the same though as normal Excel queries.

Code:
SELECT C.Customer, C.[Product List], P.Product
FROM Customer_List C, Product_List P
WHERE C.[Product List] = P.[Product List]
which can also be written as
Code:
SELECT C.Customer, C.[Product List], P.Product
FROM Customer_List C INNER JOIN Product_List P ON C.[Product List] = P.[Product List]
 
Upvote 0
try

Code:
[SIZE=1]let
    Source = Table.NestedJoin(Table10,{"Product List"},Table11,{"Product List"},"Table11",JoinKind.LeftOuter),
    #"Expanded Table11" = Table.ExpandTableColumn(Source, "Table11", {"Product"}, {"Product"})
in
    #"Expanded Table11"[/SIZE]

Table10Table11Result
CustomerProduct ListProduct ListProductCustomerProduct ListProduct
Customer1FoodFoodProduct 1Customer1FoodProduct 1
Customer 2ConsumerFoodProduct 2Customer1FoodProduct 2
ConsumerProduct 3Customer 2ConsumerProduct 3
ConsumerProduct 4Customer 2ConsumerProduct 4
ConsumerProduct 5Customer 2ConsumerProduct 5
ConsumerProduct 6Customer 2ConsumerProduct 6
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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