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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors