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
newgirl
Post Patron
Post Patron

Appending Selected Columns from Different Tables

Hi, guys!

 

My situation is I have 3 different transaction tables with different info provided but each table has some common columns that I would like to combine to create a new table.

 

For example I have these basic sample sets:

Table 1

Date1Name1Client Code1Type1
1/1/2020NewGirl5000123Retailer

 

Table 2

Name2Date2ColorClient Code2
NewBoy1/1/2020Blue5000124

 

 

Table 3

AmountDate3Name3Client Code3
50001/1/2020NewKid5000125

 

and this is my expected output:

New Table

Client CodeName
5000123NewGirl
5000124NewBoy
5000125NewKid

 

 

I was hoping to create a new table using DAX.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @newgirl ,

Here are the steps you can follow:

1. Create calculated column.

New Table =
UNION(
    SELECTCOLUMNS('Table 1',"Client Code",[Client Code1],"name",[Name1]),
    SELECTCOLUMNS('Table 2',"Client Code",[Client Code2],"name",[Name2]),
    SELECTCOLUMNS('Table 3',"Client Code",[Client Code3],"name",[Name3]))

2. Result

v-yangliu-msft_0-1608101841216.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @newgirl ,

Here are the steps you can follow:

1. Create calculated column.

New Table =
UNION(
    SELECTCOLUMNS('Table 1',"Client Code",[Client Code1],"name",[Name1]),
    SELECTCOLUMNS('Table 2',"Client Code",[Client Code2],"name",[Name2]),
    SELECTCOLUMNS('Table 3',"Client Code",[Client Code3],"name",[Name3]))

2. Result

v-yangliu-msft_0-1608101841216.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much!!

amitchandak
Super User
Super User

@newgirl , After some column renaming, you should be able to append the tables

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

Or create a bridge table for client code and use that for analysis

https://www.youtube.com/watch?v=Bkf35Roman8

https://www.seerinteractive.com/blog/join-many-many-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.