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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Humanoidhuman
Frequent Visitor

Connect Linked SQL Server to Power BI Desktop

Background and Problem:

I am trying to create a Power BI report using data pulled from MSSQL server to which I have access. I am able to successfully connect to the primary SQL server using the regular connection steps. However, the dbo which has the data I need for this particular report lives on a linked server which is connected to my primary MSSQL server (I can access it on MSSQL management studio under the path >>'Server Objects' > 'Linked Servers' > 'My Linked server').

 

Anticipated Solution:
I am hoping to establish a connection to the linked server so I can access the dbo which has the data that i need for my report. 

TIA!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

In your connection definition try running a SQL query against the linked server.

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

In your connection definition try running a SQL query against the linked server.

I tried running the a SQL script under advanced options while establishing connection to the server (picture below), but it asks for a database. For this I tried entering the linked server name as well but it doesn't establish connection saying authentication failed. I double checked my credentials and permissions all the server they seem to be all there. 

Humanoidhuman_0-1720533493986.png


I am also attaching the script I used below for reference

SELECT * FROM linkedserver.Runtime.dbo.History 
WHERE TagName = 'SysTimeSec' 
AND DateTime >= '2023-09-12 12:59:00' 
AND DateTime <= '2024-01-12 13:00:00'


Please let me know what I am doing wrong. TIA!

 

Use the initial server and database for the connection. The database is NOT optional, that dialog title is faulty.

Then run the query as you listed it.

Thank you for that. However, as you can see below, the linked servers do not fall under the any database. For this purpose I am unable to discern what to enter as a database when linking to the SQL server

Humanoidhuman_0-1720624525223.png

 

Pick any database on the original server that you have access to.

Thank you so very much. That worked!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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