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

Combining Tables from different data sources in Tabular Model

I have two different SQL server databases/data sources in my Tabular Model

I would like to combine two tables from two different sources (one table from each source) with the exact same design in my Tabular Model (NB!), but I am not sure if that is possible.

 

The graphical interface does not seem to support this, but I am wondering if it is possible with Advanced Editor/M/Power Query. The append function in the graphical interface does not seem to allow two tables from different sources

 

 

 

Sample Data:

DB's: Company1DB and Company2DB

Tables: Company1DB\FactData and Company2DB\FactData


Source 1
Company1DB\FactData table:

CompanyName      Person     Sales
A                            Peter      100
A                            Sue        200

Source 2

Company2DB\FactData table:

CompanyName      Person     Sales

B                            Peter      300
B                            Sue        400

Desired Result:

COMBINED TABLE

CompanyName      Person     Sales

A                            Peter      100
A                            Sue        200

B                            Peter      300
B                            Sue        400

 

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

In PQ, in a new Query, you can put following formula where you would need to replace Table1 and Table2 with respective query names

=Table.Combine({Table1, Table2})

View solution in original post

9 REPLIES 9
Vijay_A_Verma
Super User
Super User

In PQ, in a new Query, you can put following formula where you would need to replace Table1 and Table2 with respective query names

=Table.Combine({Table1, Table2})

Anonymous
Not applicable

How would you do this where the data source is different databases/files?

The above is not dependent upon whether data source is same or different. 

Anonymous
Not applicable

Hi

 

Thank you for helping me.

 

Could you share some M code with me?
Where do you go to create the new query?

I only know how to combine tables from the same source eg Import New Tables from a specific source and then appending multiple queries when I import multiple from the same source.

Anonymous
Not applicable

Hi @Anonymous ,

First we can import two tables via Get Data.

Here one table is derived from SQL Server and the other from PostgreSQL.

vcgaomsft_1-1694161175024.png

vcgaomsft_3-1694162958958.png

Then please try append queries as new:

vcgaomsft_4-1694163026096.png

vcgaomsft_5-1694163075706.png

Please ensure that privacy levels are consistent.

vcgaomsft_7-1694163204583.png

We can get the combined table:

vcgaomsft_8-1694163247886.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Anonymous
Not applicable

Thank you

Anonymous
Not applicable

Hi Gao

 

thank you for the screenshots.

 

I think you have answered my question indirectly. My tables is actually both of SQL databases. 

 

I believe what I don't know is How do you add a second query from a different source in the same Power Query window?

 

Also, if relevant, I use Power Query via tabular model in Visual Studio rather than Power Query in Power BI Desktop.

 

Do I add the table via import from data source two times (from each source) without importing it i.e. don't create new table until I have appended/merged?

Anonymous
Not applicable

I managed, thank you

Anonymous
Not applicable

hi @Anonymous 


I saw this response of yours on a similar posting. https://community.fabric.microsoft.com/t5/Developer/Tabular-Editor-Union-tables/m-p/2166059

 

Is it possible to append tables from two different data source in the Power Query graphical interface using the import tables from source function. Can this be done using "Expressions" part of Tabular Model?




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.

Top Solution Authors