Forum Discussion

prabavathym's avatar
prabavathym
Helper II
11 months ago
Solved

Power BI cannot connect to SQL Server

I can connect to SQL Server from Tableau (Direct Query) without issues, but Power BI fails with errors like “error: 40 - Could not open a connection to SQL Server” or “Connection Timeout / pre-login handshake failed.”

  • Connectivity test to server + port passes.

  • Tried both SQL Server connector and ODBC in Power BI.

  • Used both SERVER\INSTANCE and SERVER,PORT.

  • Tableau still works fine.

     
     

     

Why would Tableau connect successfully, but Power BI fails? Could it be driver, authentication, or encryption/TLS settings?

4 Replies

  • Hi prabavathym 

    This happens because Tableau uses its own ODBC drivers, while Power BI depends on Microsoft SQL drivers. Fix is usually:

    • Install the latest MSOLEDBSQL driver.
    • In Power BI connection >> Advanced options, test with Encrypt/Trust server certificate on/off.
    • Use SERVER,PORT instead of SERVER\INSTANCE.
    • Ensure TCP/IP remote connections are enabled in SQL Server.

    Reference: 
    https://learn.microsoft.com/en-us/sql/connect/oledb/download-oledb-driver-for-sql-server?view=sql-server-ver17 

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi prabavathym 
    Thank you for submitting your question to the Microsoft Fabric Community Forum.

    The issue arises because Power BI depends on Microsoft SQL client drivers, whereas Tableau uses its own ODBC drivers, which is why Tableau is able to connect successfully while Power BI fails with errors like error 40 or pre-login handshake timeout.

     As rohit1991  suggested, try installing  the latest Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) and the Microsoft ODBC Driver (msodbcsql17 or 18) on the machine, and also on the gateway server if you are using Power BI Service.
     

    Could you let us know if the suggested solution resolved your issue?If you still need help, please share more details so we can assist you further.

     

    Thank you.

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi prabavathym 

    I wanted to check if you’ve had a chance to review the information provided. If you have any further questions, please let us know. Has your issue been resolved? If not, please share more details so we can assist you further.

    Thank You.

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi prabavathym 

    Just checking in as we haven't received a response to our previous message. Were you able to review the information above? Let us know if you have any additional questions.

    Thank You.