How to Fix Power BI SQL Database Gateway and Connection Errors
Question details
The user needs to resolve connection and gateway errors when linking a new user to a SQL Server database via Power BI.

- Product
- Power BI
- Device & OS
- not provided
- Scenario
- Connecting a new user account to a SQL Server database for data analysis using Power BI Desktop and Power BI Online.
- Observed behavior
- Power BI Online displays an offline SQL connection and a gateway error, while Power BI Desktop throws an error stating that a key did not match any rows in the table.
Ensure you have the exact SQL Server connection details, including the server IP address, database name, and active user credentials, before modifying any gateway settings.
Verify SQL Server Credentials and Permissions
Confirm that the login credentials are correct and that the user has the necessary permissions to access the target SQL database.
Authentication failures and missing database mapping are common causes for key matching errors in Power BI Desktop.
In Power BI Desktop, navigate to 'Get Data' > 'SQL Server database'. Enter the server's IP address instead of the server name to rule out any DNS resolution problems.
Open SQL Server Management Studio (SSMS) and attempt to log in using the exact same username and password to ensure the credentials are valid and the account is not locked.
In SSMS, navigate to 'Security' > 'Logins'. Right-click the user account, select 'Properties', and check the 'User Mapping' page to ensure the user has 'db_datareader' access to the required database.

Configure Network and SQL Server Settings
Enable required network protocols and adjust firewall settings to ensure Power BI can communicate with the SQL Server.
Analyze and Visualize Data Easily with WPS Spreadsheet
While Power BI is a robust tool for complex enterprise dashboarding, everyday data analysis, reporting, and visualization can be handled effortlessly with WPS Spreadsheet. As a comprehensive office suite, it provides a seamless and lightweight environment for all your data tasks.
- 1. Download the Installer: Navigate to the official WPS Office website and click the free download button.
- 2. Install WPS Office: Run the downloaded installer and follow the on-screen prompts to set up the software on your device.
- 3. Open and Analyze Data: Launch WPS Spreadsheet, import your dataset or SQL export, and begin utilizing built-in visualization tools instantly.

Frequently Asked Questions
Why does Power BI Desktop report 'the key didn't match any rows in the table'?
This error typically means the specific table, view, or schema you are referencing in your Power Query or data model no longer exists, has been renamed in the SQL database, or the user lacks sufficient permissions to view it.
How do I fix the gateway offline error in Power BI Online?
To fix a gateway offline error, ensure that the machine hosting the On-premises data gateway is turned on and connected to the internet. Open the gateway app locally, sign in, and verify its status says 'Online and ready to be used'.
Should I use the server name or IP address when connecting Power BI to SQL Server?
It is best practice to use the server's IP address during initial troubleshooting. If connecting via the IP address succeeds but the server name fails, your network is experiencing DNS resolution issues.




