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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JoelEquestrian
New Member

Connectivity to sql server on-premise fails from within network. Direct query works though

I have setup a hybrid gateway on a server in-network and it works fine to create and publish reports when using direct query against an on-premise SQL Server instance.

 

When creating a report or changing the data source it is unable to connect via "Import" connectivity to the on-premise SQL Server even though Power BI desktop is located on an on-premise machine. Through SSMS the connection to local SQL works fine. When making the connection to SQL Server it also seems unable to create an encrypted connection and I am not sure why

 

JoelEquestrian_0-1616752280881.png

JoelEquestrian_1-1616752302544.png

 

1 ACCEPTED SOLUTION
JoelEquestrian
New Member

Problem resolved. The issue was the DBA had provided the incorrect name for the Database and we all had overlooked this. 

 

Connecting with Direct Query only the SQL Server name was provided so it worked. When connecting with Import Query the SQL Server name and the Database was provided (incorrect DB name) so it failed. 

 

Once I noticed it was the wrong DB name and corrected it then it worked fine. 

 

Just for other people as a tip:  ignore "unable to establish encrypted connection" warning when connecting to SQL server. Power BI Desktop automatically tries to establish an encrypted connection but it is not required. If SSL is required for your connections then that needs to be setup and certificates copied. See this blog post here for setting up SSL with a hybrid gateway:  https://community.powerbi.com/t5/Desktop/unable-to-connect-to-the-data-source-using-an-encrypted/m-p...

 

View solution in original post

3 REPLIES 3
JoelEquestrian
New Member

Problem resolved. The issue was the DBA had provided the incorrect name for the Database and we all had overlooked this. 

 

Connecting with Direct Query only the SQL Server name was provided so it worked. When connecting with Import Query the SQL Server name and the Database was provided (incorrect DB name) so it failed. 

 

Once I noticed it was the wrong DB name and corrected it then it worked fine. 

 

Just for other people as a tip:  ignore "unable to establish encrypted connection" warning when connecting to SQL server. Power BI Desktop automatically tries to establish an encrypted connection but it is not required. If SSL is required for your connections then that needs to be setup and certificates copied. See this blog post here for setting up SSL with a hybrid gateway:  https://community.powerbi.com/t5/Desktop/unable-to-connect-to-the-data-source-using-an-encrypted/m-p...

 

amitchandak
Super User
Super User

@JoelEquestrian , I also got this warning. But after ok, I was able to connect.

 

If SQL Server is on the local machine, try to use Windows Authentication, if that is working. If yes, then it might be a credential issue.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit. That is not the issue. The credentials work without issue whether I login with SSMS using SQL credentials or Windows Authentication

 

The issue is that Direct Query can make a connection to the SQL server but Import query cannot. There is also a Hybrid Gateway setup but that should not matter when connecting on-premise to an on-premise SQL server.

 

Is there something special that needs to be setup to allow Power BI Desktop to connect via Import Query to SQL Server on-premise?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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