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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
MAAbdullah47
Helper V
Helper V

create new table with with additional columns from another table in dax

Dear All ,

 

I have 2 tables with 90 % same structure (same no of rows):

 

Table -1 : col-1,col2,col3

 

Table-2 : col1,col2,col3,col4

 

I want to:

 

1-Add col4 with the same content from Table-2 to table-1.

2-Copy the contents of col2 (Table-2) and Paste it in col2 for Table-1

 

 

After that, I 'll remove Table-2, Please advise.  

 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@MAAbdullah47,


You can perform the following steps in Query Editor.

1. Add a index column for Table-1 and Table-2.
1.PNG

2.Merge Table-1 and Table-2 by clicking “Merge Queries as New”.
2.PNG

3.PNG

3. Expand col2 and col4 from the column as below in the merged table.
3.PNG5.PNG

4. Select “col2” and “Index”, then remove the two columns.
6.PNG

5. Rename Table-2.col2 and Table-2.col4.
7.PNG

Regards,

Community Support Team _ Lydia Zhang
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
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@MAAbdullah47,


You can perform the following steps in Query Editor.

1. Add a index column for Table-1 and Table-2.
1.PNG

2.Merge Table-1 and Table-2 by clicking “Merge Queries as New”.
2.PNG

3.PNG

3. Expand col2 and col4 from the column as below in the merged table.
3.PNG5.PNG

4. Select “col2” and “Index”, then remove the two columns.
6.PNG

5. Rename Table-2.col2 and Table-2.col4.
7.PNG

Regards,

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

May be easier to do this in Power Query. What are the sources of the tables? For example, in Power Query, you should be able to do a Merge query between the two queries you have. Are these tables comprised purely of columns imported from sources or are some of these columns calculated?

 

Otherwise, you might look at NATURALINNERJOIN, INTERSECT, UNION or other similar types of DAX functions.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Kindly can you give me by example ?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.