Windows Without Impersonation Power BI: Fix Data Source Errors
In this article
Yes, you can resolve "Windows without impersonation" errors in Power BI by switching the data source authentication method to use specific service accounts or by enabling DirectQuery with proper credentials. This error typically occurs when Power BI attempts to access on-premises data sources (like SQL Server or file shares) using the default Windows Authentication mechanism without a designated identity, causing security validation failures during refresh.
What You'll Need
- A Power BI Desktop file (.pbix) containing the problematic report.
- An on-premises data gateway installed and configured if your data source is local.
- Administrative access to the data source (e.g., SQL Server Management Studio) to create dedicated service accounts.
- Power BI Service workspace permissions to edit dataset settings.
Step-by-Step
- Identify the Data Source: Open your Power BI Desktop file. Navigate to File > Options and settings > Gateway connections. Note which data sources are throwing the impersonation error. These are usually relational databases or file systems requiring Windows Authentication.
- Create a Dedicated Service Account: Do not use your personal account. In your organization's Active Directory, create a new user account specifically for Power BI data refreshes (e.g., "PBIDataService"). Grant this account read-only permissions to the specific database or folder it needs to access. This isolates security risks and simplifies credential management.
- Update Power Query Credentials: In Power BI Desktop, go to Home > Transform data to open the Power Query Editor. For each query connected to the affected source, click Home > Advanced Editor. Ensure the connection string uses the correct protocol. Close the editor and return to the main view. Click Home > Edit Credentials.
- Select Connection Type: In the credentials dialog, choose Windows as the connection type. Instead of leaving it blank or selecting "Use my current credentials," select Organizational account or enter the specific username and password of the service account created in Step 2. If prompted, ensure the option to "Connect anonymously" is unchecked unless explicitly required for public web sources.
- Configure the On-Premises Data Gateway: If you are using a gateway, open the gateway management interface. Navigate to the Data Sources tab. Find the specific source causing the error. Click Edit and update the credentials to match the service account details entered in Power BI. This ensures the gateway authenticates correctly when pushing data to the cloud.
- Publish and Test Refresh: Save your .pbix file and publish it to the Power BI Service. Go to the workspace, find the dataset, and click Refresh now. Monitor the activity log. If the refresh succeeds, the impersonation issue is resolved. If it fails, check the error message for specific timeout or permission denial codes.
Common Mistakes
The most frequent error is attempting to use "My Windows User Account" for automated refreshes. This fails because the background service does not have your interactive login session active. Another common mistake is neglecting to update the gateway credentials after changing the service account password, leading to immediate authentication failures upon the next scheduled refresh. Users also often confuse "Impersonate" with "Delegate"; ensure you understand whether the source requires direct authentication or Kerberos delegation, as misconfiguring this leads to cascading access denied errors.
Tips
Always use least-privilege principles for service accounts. Grant only the minimum permissions necessary for the queries to run. Regularly audit these accounts to ensure they are not being used for other purposes. When dealing with multiple tables from the same source, group them under a single credential entry in Power BI to reduce complexity. If you encounter intermittent issues, verify that the time synchronization between your gateway machine, the data source server, and the Power BI service is within acceptable limits, as Kerberos authentication is highly sensitive to time drift.
Troubleshooting
If the refresh still fails after following the steps above, start with the simplest checks. First, verify that the service account password has not expired. Second, ensure the gateway is running and connected to the Power BI Service. Third, check the firewall rules on the data source server to confirm that the gateway machine's IP address is whitelisted. If the error persists, try clearing the cached credentials in Power BI Desktop by going to File > Options > Current File > Data Load and clearing any stored credentials, then re-entering them. For SQL Server specifically, ensure that TCP/IP protocols are enabled in the SQL Server Configuration Manager. If you suspect a delegation issue, consult your IT administrator to verify Kerberos constrained delegation is properly configured for the service account.
Frequently Asked Questions
Can I use a Microsoft Account instead of an Organizational Account?
No. On-premises data sources requiring Windows Authentication must use an Organizational Account (Azure AD or Active Directory). Personal Microsoft Accounts cannot authenticate against enterprise internal servers.
Why do I get an error even after entering the correct password?
This is often due to time synchronization issues between the gateway machine and the domain controller. Ensure all machines are synced via NTP. It may also indicate that the account lacks specific network permissions to reach the data source.
Is it safe to share the service account password with developers?
It is safer to use managed identities or certificate-based authentication where possible. If passwords must be shared, use a secure password manager and enforce regular rotation policies. Avoid hardcoding passwords in scripts or queries.
Does this fix apply to Excel files stored on SharePoint?
Partially. For SharePoint Online, you typically use OAuth2 authentication. For on-premises SharePoint, you may need Windows Authentication. The principle remains the same: use a dedicated service account rather than your personal credentials.
How often should I rotate the service account password?
Follow your organization's security policy. Typically, every 90 days is standard. Remember to update the password in both Power BI Desktop (for testing) and the On-Premises Data Gateway immediately after rotation.
What happens if the service account is disabled?
All data refreshes dependent on that account will fail immediately. Power BI will display an authentication failure error. You must re-enable the account or switch to a different valid service account to restore functionality.