Excel All Combinations Using Power Query - 2424

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Aug 15, 2021.
Kartikey has 6800 rows of data. For each product in column A, he needs every combination of Column B with Column C. In this episode, Bill uses Power Query and a Full Outer Join to solve the problem.
maxresdefault.jpg


Transcript of the video:
Learn Excel from MrExcel Podcast episode 2424. All combinations using power query.
Hey, welcome back to MrExcel netcast. I'm Bill Jelen.
Today's questions sent in by Kartikey.
This one threw me for a loop but it's actually easy to do.
For product A, Karticky needs all of these codes combined with all of these numbers. There's not the same number, right?
So if we have five of the first and seven in the second, we want 35 rows.
We are going to do this using power query.
So the first thing I need to do is make it into a table with CTRL+T like that.
And we are going to do 2 initial queries that will be sub queries.
So here on the Data tab, this used to say, “From Table or Range”.
In my beta it now says “From Sheet”. And we call this step one.
And what we're going to do is we don't need column C in this one, so I'll remove.
And then anytime that this is null, I'll get rid of those.
Alright, So what we have is all of product a. Those are the codes from B.
And we're going to click Close and Load To….
Only create a connection. Click OK.
Alright, so there's our step one Now, we do From Sheet. And this will be called Step 2.
It's going to be exactly the same thing, but will be getting codes from column C.
So I'll remove column B. Get rid of the nulls here. Click OK.
Close and load to…. Only create a connection.
Alright, so we over here we have connections for step one and Step two.
From a blank cell, Get Data, Combine queries, Merge.
And from step one we use product.
From Step 2 use Product Select a full outer join - all rows from both. Click OK.
Expand Step 2 so we can get the item C. We don't need the original column name as prefix.
And close and load. 16,390 combinations.
This is a great time to talk about the new second edition: Master Your Data.
This is formerly M is for (Data) Monkey. It is now available.
Click that I in the top right hand corner.
If you like these tips, please, down below, Like, Subscribe, and Ring the Bell.
Feel free to post any questions or comments down in the comments below.
I want to thank Kartikey for sending that question and I want to thank you for stopping by.
We'll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,221,532
Messages
6,160,381
Members
451,643
Latest member
nachohoyu

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