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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
rajcha
Frequent Visitor

How to give 2 or more data sources in blank query

I have a requirement where I have to join two tables from two different data sources. I have selected the blank query option and I am writing the query in the advanced editor option available in the query editor. This advanced editor allows me to enter only one data source. Is there a way where I can give two or more data sources.

 

The below works.

 

let
 Source = Sql.Database("servername", "datasource1",
   [Query="SELECT BusinessEntityID, FirstName, MiddleName, LastName,
     JobTitle, City, StateProvinceName, CountryRegionName, TerritoryName,
     TerritoryGroup, SalesYTD, SalesLastYear
     FROM Sales.vSalesPerson;"])
in
 Source
 
"datasource1" is one data source.
My question is how to add another datasource.
 
Thanks.
2 ACCEPTED SOLUTIONS
ImkeF
Community Champion
Community Champion

No reason to make life unnecessarily difficult: Just use the import functions for 2 different queries and then join them afterwards.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

@rajcha I think there is a little confusion here. You can write your SQL queries, as Imke suggests, do this in two seperate queries. Then, in Power BI, you can use merge or append them depending on your needs.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

View solution in original post

3 REPLIES 3
ImkeF
Community Champion
Community Champion

No reason to make life unnecessarily difficult: Just use the import functions for 2 different queries and then join them afterwards.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

rajcha
Frequent Visitor

I have to use temp tables in my query. So writing a query is unavoidable in my case. 

@rajcha I think there is a little confusion here. You can write your SQL queries, as Imke suggests, do this in two seperate queries. Then, in Power BI, you can use merge or append them depending on your needs.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors