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
Anonymous
Not applicable

Power Query Combine EXISTING tables in tabular model

I would like to combine two existing/already imported tables and form a new table without having to "re-import" them (importing table, duplicate query, merge and then import the combined table). Thus I wont have to redo existing work.

 

These would be the existing two tables.

 

nikilouwgmail_0-1679741274694.png

 

I would then open Power Query by clicking on of them and selecting Designer to launch Power Query.

BUT then when I go to Combine it wont show me the second table which I want to combine with.

nikilouwgmail_1-1679741363004.png

 

Is there a way to combine these two existing tables? Am I missing something simple or is there a more complicated solution.

 

 

 

4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can use the shared Expression to help merging two existing tables:

Here is a simple sample:

vjianbolimsft_0-1680160100097.png

First create a shared expression:

vjianbolimsft_1-1680160457520.png

Then you can use the expression to merge/ append:

vjianbolimsft_2-1680160543814.png

Then create new table and import

vjianbolimsft_3-1680160588081.png

 

Final output:

vjianbolimsft_4-1680160658640.png

 

Besides, you may need to create relationship for the new created table manually.

 

Best Regards,

Jianbo Li

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

 

 

Anonymous
Not applicable

hi @v-jianboli-msft 

 

Thank you for the response. I would like to merge existing tables imported from SQL server source under "Data Sources".

 

It seems that is not possible. You have to create your data sources as expressions in order to merge them.

v-jianboli-msft
Community Support
Community Support

Hi @Anonymous ,

 

This article may help you: Quirks of Visual Studio Query Editor working with Analysis Services – business intelligist

 

If you were to open the Query Editor screen for another table in the Tables folder, you will not see any other tables, but you will see the new (shared) Expression. With this, you can merge, append, or do whatever else you’d like.

 

Best Regards,

Jianbo Li

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

Anonymous
Not applicable

hi @v-jianboli-msft 

 

So it seems that it is not possible to say merge two existing tables imported from the source eg a table/view from SQL database?

 

Or are you saying that you should copy ALL your SQL queries into the "native query" part of Power Query?

 

nikilouwgmail_0-1680114245210.png

 

 

It seems that this may not be effecient if the majority of the model's source is from SQL. Also would all relationships be created automatically if you generate all tables in this manner?

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.