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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lastnn30
Post Patron
Post Patron

Appending and Merging tables

Hi

I can merge 2 tables using Data Modeling of Power BI. I also understand that I can click on Transfer Data and merge 2 tables using Power Query. So what is the difference? 

 

Also can Data Modeling in Power BI, append tables (stack tables one on top of each other)? Or for that I have to use Power Query of Power BI? 

 

Thank you. 

2 ACCEPTED SOLUTIONS
nvprasad
Solution Sage
Solution Sage

Hi lastnn30,

 

The merging or appending which we perform in Powerquery editor is the best practice as it compresses data to reduce the size of the file.

 

You can append tables in the PowerBI desktop using the "UNION" DAX function. Ex: Union (table 1, table 2).

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

View solution in original post

v-rzhou-msft
Community Support
Community Support

Hi @lastnn30 ,

 

You can create a new merge table by join tables by key columns by Dax or by Power Query. If you do merge in Power Query, you don't need to create a new table so you can reduce the size of the file. Also, you can do some transform on the merged table. However, you couldn't see the merged table created by dax in Power Query. 

 

As far as I know, we couldn't append tables by Dax in Power BI. UNION function doesn't work like append.

For example, there are two tables, Table1 with ColumnA and Column B, Table2 with ColumnC and ColumnD. 

RicoZhou_0-1651041262923.png

RicoZhou_1-1651041291652.png

Append in Power Query will expand the new table and return a new table with four columns (A,B,C,D).

RicoZhou_2-1651041348712.png

However, UNION will only return two columns based on left table. And the two tables must have the same number of columns.

RicoZhou_3-1651041373545.png

So you have to use Power Query of Power BI to append tables.

 

Best Regards,
Rico Zhou

 

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

The Union idea is brilliant. Thank you so much all. I appreciate the help.

v-rzhou-msft
Community Support
Community Support

Hi @lastnn30 ,

 

You can create a new merge table by join tables by key columns by Dax or by Power Query. If you do merge in Power Query, you don't need to create a new table so you can reduce the size of the file. Also, you can do some transform on the merged table. However, you couldn't see the merged table created by dax in Power Query. 

 

As far as I know, we couldn't append tables by Dax in Power BI. UNION function doesn't work like append.

For example, there are two tables, Table1 with ColumnA and Column B, Table2 with ColumnC and ColumnD. 

RicoZhou_0-1651041262923.png

RicoZhou_1-1651041291652.png

Append in Power Query will expand the new table and return a new table with four columns (A,B,C,D).

RicoZhou_2-1651041348712.png

However, UNION will only return two columns based on left table. And the two tables must have the same number of columns.

RicoZhou_3-1651041373545.png

So you have to use Power Query of Power BI to append tables.

 

Best Regards,
Rico Zhou

 

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

 

nvprasad
Solution Sage
Solution Sage

Hi lastnn30,

 

The merging or appending which we perform in Powerquery editor is the best practice as it compresses data to reduce the size of the file.

 

You can append tables in the PowerBI desktop using the "UNION" DAX function. Ex: Union (table 1, table 2).

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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