You have a workbook set up with Power Query scheduled refresh, but after updating the data source credentials, the refresh stops working and shows an error. This happens because Power Query stores a separate credential cache that is not automatically updated when you change your source login. This article explains why the credential mismatch occurs and provides the exact steps to clear the old credentials and reapply them so your scheduled refresh runs again.
Key Takeaways: Fixing Power Query Refresh After Credential Change
- Data Source Settings > Edit Permissions: Remove the old cached credentials for each data source in the workbook.
- Power Query Editor > Data Source Settings: Manually clear all stored credentials for the affected source.
- Gateway connection > Edit > Test Connection: Re-enter the new credentials and verify the connection works before saving.
Why Power Query Refresh Fails After a Credential Change
Power Query stores credential information in a local cache separate from the workbook data. When you change the password or the user name for a data source, Power Query does not automatically detect the change. The scheduled refresh job uses the cached credentials, which are now invalid. The result is a refresh failure with an error message such as “Failed to update database” or “Could not authenticate.” This behavior is by design to prevent credential prompts during unattended refresh, but it requires manual intervention after any credential update.
Where Credentials Are Stored
Credentials are stored at the workbook level inside Power Query data source settings. They are also cached in the Power Query engine when a connection is first established. For workbooks that use a Power BI gateway for on-premises data, the gateway also maintains its own credential store. You must update credentials in all three locations to restore scheduled refresh.
Common Scenarios That Trigger This Issue
This problem occurs most often when an IT administrator resets your domain password, when a database login password expires, or when you switch from Windows authentication to SQL Server authentication. Each scenario requires the same fix: clear the old credentials and re-enter the new ones.
Steps to Clear and Reapply Power Query Credentials
Follow these steps in order. Do not skip any step. If you are using a Power BI gateway, complete all steps on the computer where the gateway is installed.
- Open the workbook and go to Data Source Settings
In Excel, go to the Data tab. Click Queries & Connections to open the pane. Right-click any query in the list and select Edit. In the Power Query Editor, go to File > Options and settings > Data source settings. - Select the affected data source and clear its permissions
In the Data Source Settings dialog, select the source that is failing. Click Clear Permissions. A confirmation message appears. Click Delete. Repeat for each data source that uses the changed credentials. - Close the Power Query Editor and save the workbook
Click Close & Load to return to Excel. Save the workbook. This step ensures that the cleared permission state is written to the file. - Reopen the workbook and re-enter credentials
Close and reopen the workbook. Go to Data > Queries & Connections. Right-click a query and select Refresh. Excel prompts you for credentials. Enter the new user name and password. Check Remember my credentials if you want the scheduled refresh to use these credentials without prompting. Click Connect. - Test the refresh for all queries
Refresh each query in the workbook by selecting Data > Refresh All. Verify that no authentication errors appear. If any query still fails, repeat steps 1 through 4 for that specific source. - Update the gateway credential store if using a gateway
Open the Power BI Gateway app on the server. Go to the Data Sources tab. Select the data source that corresponds to the workbook. Click Edit. Re-enter the new credentials. Click Test Connection. If the test succeeds, click Apply. - Verify the scheduled refresh runs
In Excel, go to Data > Queries & Connections > Properties. On the Scheduled Refresh tab, confirm that the schedule is still enabled. Click Refresh Now to trigger an immediate refresh. If it completes without error, the fix is successful.
If the Scheduled Refresh Still Fails After Updating Credentials
Power Query Shows “Credentials Are Missing” Error
This error appears when the credential cache was not fully cleared. Go back to the Power Query Editor and open Data Source Settings. Click Permissions for each source listed. If any entry shows a credential type, click Clear Permissions again. Then close and reopen the workbook before re-entering the new credentials.
Scheduled Refresh Works Manually but Fails on Schedule
This indicates that the credentials were not saved with the workbook. Open the workbook again and refresh each query. When the credential prompt appears, make sure you check Remember my credentials. If you are using a gateway, verify that the gateway account has permission to access the data source.
Gateway Connection Fails After Password Reset
The gateway stores its own credential set that is separate from the workbook. Open the Power BI Gateway app, go to Data Sources, and edit each affected source. Enter the new password. Run a test connection. If the test fails, check that the gateway service account has the correct permissions on the database. Restart the gateway service after the update.
Manual Refresh vs Scheduled Refresh: Key Differences
| Item | Manual Refresh | Scheduled Refresh |
|---|---|---|
| Credential prompt | Appears if credentials are missing or invalid | Uses stored credentials only; no prompt appears |
| Gateway requirement | Not required for local files | Required for on-premises data sources |
| Credential update behavior | Prompts for new credentials on next refresh | Fails silently until credentials are manually cleared and re-entered |
| Refresh trigger | User clicks Refresh | Excel timer or Power BI service schedule |
After you update your credentials, you can now restore your Power Query scheduled refresh by clearing the old cached credentials in the Data Source Settings dialog and re-entering the new ones. Next, test the refresh manually before relying on the automated schedule. As an advanced tip, consider using a shared data source in the Power BI gateway so that credential updates can be applied in one place instead of per workbook.