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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
akhil5656
Frequent Visitor

How to connect two data sources with direct query

I am creating a dashboard to monitor SQL Agent jobs on Power BI Dashboard for different servers in my network. I have connected one data source with the direct query and when I am trying to connect the second data source with the direct query it popping up a caution to change into import mode. my question was How to connect the two more databases with the direct query?

1 ACCEPTED SOLUTION
BILASolution
Solution Specialist
Solution Specialist

7 REPLIES 7
islamabdelghany
Regular Visitor

You can now connect to more than one direct query souces, introducing Composite Models in November 2018.
All tables should be in a single database is no longer a limitation 

 

 

islamabdelghany_0-1754835951162.png

 


https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-composite-models

Anonymous
Not applicable

Hi @akhil5656 
Try the following:

1. Create SQL Views for your queries in a single database, reference your tables with full qualified names (including database name).

2. In Power Query when you select from database source, select your database where you have created your SQL Views.

3. Use the tables listing mode (instead of advanced) and select your views that you have created in step 1.

Cheers,
Sven

Kartic21
Helper I
Helper I

It seems there is solution for the same.

 

Mention the same "Database" name in both the SQL Server DB popup and

 

In advanced query(where we are refering to another DB ) refer the table in the query with DB name 

 

eg select * from Databasename.dbo.tablename

 

This worked for me while direct query was intact !!

BILASolution
Solution Specialist
Solution Specialist

Hi @akhil5656

 

Nowadays, you can't do that...

 

direct query.png

 

 

 

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-use-directquery/

 

Regards

BILASolution

 

Is there any other way to connect two or more database live in Power BI Desktop?

@akhil5656

 

I think an alternative to solve your question, but you need Power BI Services. You can create differents reports per each data source by direct query in power BI desktop, then publish them in power bi service. Finally create a dashboard that shows a mix of report parts.

How can I mix two reports into one dashboard? can you help me, please?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.