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
carinat
Advocate II
Advocate II

Joining contents of two tables into one new calculated table

I'm trying to combine two tables into a new calculated one. The tables don't have the same amount of columns so I can't use a UNION. They do however have two columns with the same name and sort of data.

 

Table1    Table2

col1        col1

col2        col2

colA       colB

colC

 

I would now like a Table3 containing col1 and col2 from both tables 1 and 2. Table3 needs to only have those two columns (and not 4 - i.e. not two from each but just a combination).

 

I still want to keep Table1 and Table2 with all their columns so I can't just remove them in the query and thereafter use UNION either.

 

Does anyone have an idea of how to proceed?

1 ACCEPTED SOLUTION
itayrom
Resolver II
Resolver II

 

The following expression should do the trick-

 

Table3 = UNION(
	SELECTCOLUMNS(Table1, "col1", [col1], "col2", [col2]),
	SELECTCOLUMNS(Table2, "col1", [col1], "col2", [col2])
)

 

View solution in original post

3 REPLIES 3
itayrom
Resolver II
Resolver II

 

The following expression should do the trick-

 

Table3 = UNION(
	SELECTCOLUMNS(Table1, "col1", [col1], "col2", [col2]),
	SELECTCOLUMNS(Table2, "col1", [col1], "col2", [col2])
)

 

Thanks a lot itayrom!

You're most welcome.

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.