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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
wollensack
Frequent Visitor

How to join column data from 2 separate steps

"Data1" is a source file that contains over 40 columns

 

I have created code that dynamically retrieves 2 columns (in a step called "Table1)

Columns are [Stage] [Invoice]

 

Second step retrieves 4 columns (in a step called "Table2")

Columns are [1/09/2022] [1/10/2022] [1/11/2022] [1/12/2022]

Both steps only contains 1 row (for this scenario)

I now want to create a step that merges the columns from Step "Table1" and "Table2"

I also created 2 lists which stores the column names I require

 

The problem is that my attempt brings them together but gives me two rows.

 

I tried to use M code "= Table.SelectColumns(Table1,List1)&Table.SelectColumns(Table2,List)"

 

Output looks like this

StageInvoice  1/09/20221/10/2022  1/11/20221/12/2022
FirstB2348-B nullnullnullnull
nullnull23.5465.7687.2312.54

but should be this

StageInvoice  1/09/20221/10/2022  1/11/20221/12/2022
FirstB2348-B 23.5465.7687.2312.54

 

Hope I explained this enough

 

thankyou

Frank

2 ACCEPTED SOLUTIONS
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Use this

=Table.FromColumns(Table.ToColumns(Table.SelectColumns(Table1,List1))&Table.ToColumns(Table.SelectColumns(Table2,List)), List1&List)

👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)

How to get your questions answered quickly -- How to provide sample data

View solution in original post

wdx223_Daniel
Community Champion
Community Champion

if these two table come from same soure, try this

=Table.SelectColumns(Data1,list1&list2)

View solution in original post

2 REPLIES 2
wdx223_Daniel
Community Champion
Community Champion

if these two table come from same soure, try this

=Table.SelectColumns(Data1,list1&list2)

Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Use this

=Table.FromColumns(Table.ToColumns(Table.SelectColumns(Table1,List1))&Table.ToColumns(Table.SelectColumns(Table2,List)), List1&List)

👍 It's been a pleasure to help you | Help Hours: 11 AM to 9 PM (UTC+05:30)

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors