Power Query Problems

Fix Excel Power Query Using the Wrong ODBC Credentials

Huma Ashraf ChHuma Ashraf Ch Oct 29, 2026 868 views

Question details

The user needs to prevent Excel Power Query from applying the wrong stored ODBC credentials when multiple workbooks connect to the same SQL database.

Fix Excel Power Query Using the Wrong ODBC Credentials
Product
Microsoft Excel
Device & OS
not provided
Scenario
Opening two separate Excel workbooks that connect to the identical SQL database via ODBC but require distinct login credentials.
Observed behavior
When the first workbook is opened, its credentials are cached globally, causing the second workbook to automatically use the wrong stored credentials and fail to connect properly.
Before you start

Ensure you close all active Excel workbooks that are connected to the database before modifying credentials, so that the cache is not locked during the reset process.

Solution 1Recommended

Clear Stored Credentials and Restrict the Scope Level

This recommended solution clears the incorrectly cached logins and applies new credentials specifically scoped to the database level rather than globally.

Excel sometimes caches Power Query credentials at a global or server level by default. When multiple workbooks access different databases on the same server, this can cause authentication conflicts. Forcing the credentials to apply only to the specific database scope prevents workbooks from sharing the wrong login details.

1
Open Data Source Settings

Launch Excel and navigate to the 'Data' tab on the ribbon. Click on 'Get Data' and select 'Data Source Settings' from the drop-down menu.

2
Clear Existing Credentials

In the Data Source Settings dialog, locate your SQL database connection under the 'Global permissions' tab. Select it, click 'Clear Permissions' (or 'Clear All Permissions' if needed), and confirm the deletion.

3
Reconnect to the Database

Close the settings window. Go back to 'Data' > 'Get Data', choose your specific database connector (e.g., ODBC or SQL Server), and enter the connection string to initiate a new connection.

4
Set the Credential Scope

When prompted for credentials, open the 'Database' tab on the left side of the prompt. Look for the 'Select which level to apply these settings to' drop-down at the bottom, and choose the most specific database path available (instead of the server root). Enter the correct username and password, then click 'Connect'.

Clear Stored Credentials and Restrict the Scope Level
Scope Isolation: By selecting the exact database path in the drop-down, Excel will isolate these credentials from other workbooks querying different databases on the same server.
Free Microsoft Office alternative

Try WPS Office for Seamless Data Management

If you frequently encounter complex credential caching issues or software version limitations in Microsoft Office, consider switching to WPS Office. It provides a lightweight, free alternative that easily handles everyday spreadsheet tasks without the heavy overhead.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Software: Run the downloaded file and follow the straightforward setup wizard to install WPS Office on your device.
  3. 3. Open Your Workbooks: Launch WPS Spreadsheets, open your existing .xlsx files, and enjoy a seamless, hassle-free data editing experience.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv)Lightweight architecture free from complicated global credential caching issuesFamiliar user interface requiring zero learning curve to get startedFast processing for daily data filtering and analysis tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the 'Select which level to apply these settings to' drop-down appear in my Excel?

This specific credential scoping feature was introduced in later builds of Microsoft 365. If you are using an older version of Excel (like early builds of version 16.0), you need to update your Office suite via File > Account > Update Options to access this drop-down.

Will clearing my Data Source Settings delete my Power Query steps?

No. Clearing permissions in the Data Source Settings only removes the cached usernames and passwords used to authenticate the connection. Your actual queries, M-code, and transformation steps remain completely intact.

Does this issue happen with other database types besides SQL via ODBC?

Yes, Power Query's global credential caching can affect various data sources, including native SQL Server connections, Web APIs, and OData feeds if multiple queries point to the same host but require different credentials.