Power Query - Join And Fill Rows

lager1001

Board Regular
Joined
May 17, 2019
Messages
88
I need to make the following two tables:

T1 T2

ABC 123
DEF 456
GHI 789

Do the following:

ABC 123
ABC 456
ABC 789
DEF 123
DEF 456
DEF 789
GHI 123
GHI 456
GHI 789

I may be over thinking it or maybe not Googling the right terminology to do this.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Each = Table.AddColumn(Source, "T2", each Table2),
    Expand = Table.ExpandTableColumn(Each, "T2", {"T2"}, {"T2"})
in
    Expand

T1T2T1T2
ABC123ABC123
DEF456ABC456
GHI789ABC789
DEF123
DEF456
DEF789
GHI123
GHI456
GHI789
 
Upvote 0
I spoke too soon. I guess I should have clarified, the tables are each their own table in Power Query. Not just columns in the same table.
 
Upvote 0
as you see in post#2 there are two tables (blue) with single column each, so ?

use XL2BB to show what you have and what you want
 
Upvote 0
like this?
but imho it doesn't make sense

T1T2T1T2
ABC123ABC123
DEF456ABC456
GHI789ABC789
DEF123
DEF456
DEF789
GHI123
GHI456
GHI789
 
Upvote 0
your answer is enigmatic ?
but I understand you want to see M-code, so ...

base table (as connection)
Rich (BB code):
// cartesian
let
    tbl2 = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    tbl1 = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"each" = Table.AddColumn(tbl1, "custom", each tbl2),
    expand = Table.ExpandTableColumn(#"each", "custom", {"T2"}, {"T2"})
in
    expand

first reference table
Rich (BB code):
// cartesianT1
let
    Source = cartesian,
    TSC = Table.SelectColumns(Source,{"T1"})
in
    TSC

second reference table
Rich (BB code):
// cartesianT2
let
    Source = cartesian,
    TSC = Table.SelectColumns(Source,{"T2"})
in
    TSC
 
Upvote 0

Forum statistics

Threads
1,223,798
Messages
6,174,667
Members
452,576
Latest member
AlexG_UK

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