Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
Solved! Go to Solution.
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})
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})
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.
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.
Hi @Anonymous ,
First we can import two tables via Get Data.
Here one table is derived from SQL Server and the other from PostgreSQL.
Then please try append queries as new:
Please ensure that privacy levels are consistent.
We can get the combined table:
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
Thank you
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?
I managed, thank you
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?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |