Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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

 

  • 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})

9 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Most Valuable Professional

    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's avatar
      Anonymous
      Not applicable

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

      • Vijay_A_Verma's avatar
        Vijay_A_Verma
        Most Valuable Professional

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