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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Renata_Franczak
New Member

Creating semantic model sql connection error

Hi all,

I am new here and new to Power BI and I'm having some errors. Hopefully someone will be able to help. I have uplaoded Power BI dashboard and created gateway on-premises. Now, I want the dashboard, which pulls out the data from sql objects, to refresh automatically. I wanted to create an sql connection but I'm having this error message:

Unable to create connection for the following reason: Logging into Sql server failed. Possible reasons for this error include an invalid authentication mode, a missing login in Sql server, a login from an untrusted domain or a problem contacting the domain controller for the authentication request.

The creadentials are correct. And I tried different options of authentication, nothing seems to be working.

I appreciate any help!

Regards 

Renata

1 REPLY 1
johnbasha33
Super User
Super User

 It sounds like your Power BI gateway is having trouble authenticating with SQL Server. Here are a few things you can check to resolve the issue:

1. Verify Authentication Mode in SQL Server

Since you're connecting to an on-premises SQL Server, make sure SQL Server authentication is enabled:

  • Open SQL Server Management Studio (SSMS)

  • Run the following query to check the authentication mode:

    SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') AS AuthMode;
    • If it returns 1, it means SQL Server is only allowing Windows Authentication.
    • If it returns 0, both Windows Authentication and SQL Authentication are enabled.
    • If needed, enable SQL Server Authentication:

      • In SSMS, right-click on the server → Properties → Security
      • Select SQL Server and Windows Authentication mode
      • Restart the SQL Server service.

        2. Check the SQL Server Login

        • If using Windows Authentication, ensure the account running the gateway service has access to SQL Server.
        • If using SQL Server Authentication, verify the username and password exist:
          SELECT name FROM sys.sql_logins WHERE name = 'your_username';
          • If the login doesn’t exist, create one:
            CREATE LOGIN your_username WITH PASSWORD = 'your_password';
          • Then grant access to the database:
            USE your_database;
            CREATE USER your_username FOR LOGIN your_username;
            ALTER ROLE db_datareader ADD MEMBER your_username;
            ALTER ROLE db_datawriter ADD MEMBER your_username;

            3. Ensure the Gateway Can Access SQL Server

            • Go to On-premises Data Gateway → Service Settings
            • Check that the gateway service account (NT SERVICE\PBIEgwService) has permissions to access SQL Server.
            • Try running telnet your_sql_server 1433 from the machine where the gateway is installed to see if it's reachable.

              4. Use the Correct Data Source Settings in Power BI Service

              • In Power BI Manage Gateways, ensure the data source credentials match those in SSMS.
              • If using Windows Authentication, try entering the credentials as DOMAIN\username.

                5. Check Firewall & Network Issues

                • If the SQL Server is on a different machine, ensure port 1433 is open.
                • If your SQL Server is using a named instance, make sure the SQL Browser service is running to resolve dynamic ports.

                  6. Restart Gateway and Test Again

                  • Restart the Power BI Gateway Service
                  • Restart the SQL Server service

                    Let me know what errors you see after trying these steps! 🚀

                    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

  •  

@Renata_Franczak

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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