Sub topic 14
Troubleshooting common connection and refresh errors
This chapter assumes you have built queries against Excel, CSV, and SharePoint sources in Power BI Desktop. It also assumes you know what applied steps, credentials, privacy levels, parameters, and the on-premises data gateway are. Most failures fall into a few groups. Once you know which group an error belongs to, the fix is usually short.
A working model for diagnosing errors
Every refresh runs the same chain: reach the source, authenticate, run the applied steps, and load the result. The error message tells you which link broke.
Work from left to right. Do not edit applied steps to fix a problem that happens at the authentication link.
Errors reaching the source
These errors mean Power Query could not find the file or site.
- "The system cannot find the path specified" or "Could not find file." The path is wrong, or the file moved. A path such as
C:\Data\Sales.xlsxalso does not exist on the Power BI service. Use a parameter for the location, as in the parameters chapter, so you change it in one place. - "We couldn't find any data formatted as a table" or a missing sheet or table. Someone renamed or deleted the sheet or table. Open the Navigation step in Power Query Editor and check which items the workbook now contains.
- SharePoint 404 or access denied. The site URL in
SharePoint.FilesorSharePoint.Tablesmust be the site root, such ashttps://contoso.sharepoint.com/sites/Sales. It must not be a link to a document or a view. Also check that your account has access to the site.
Errors in applied steps
These appear after the data arrives.
- "Column 'X' of the table wasn't found." The source header changed, so a later step such as a type change or a rename no longer matches. Fix the step, or open the source and restore the header.
- "We couldn't convert to Number" or "DataFormat.Error". A cell holds text such as
N/Ain a column you typed astype number. Replace or remove the bad values before the type step. Dates can fail when the file uses a different locale from yours. Use Change Type with Locale in that case. - Garbled characters or one wide column from a CSV. The delimiter or encoding is wrong. Set
DelimiterandEncoding = 65001for UTF-8 inCsv.Document. - Headers appear as data. The promote-headers step is missing, or an extra title row sits above the header. Remove the top rows first, and then promote.
Credential and privacy errors
- "Credentials are required to connect" or "The credentials provided are invalid." Open Data source settings and clear the permissions for that source. Then re-enter them. SharePoint Online needs an organizational account, not Anonymous.
- "Formula.Firewall: Query references other queries or steps, so it may not directly access a data source." Two sources with different privacy levels are being combined in one query. Set each source to the correct level, such as Organizational for SharePoint and Private for local files. Alternatively, split the work so one query loads each source and another query merges them.
Errors that only appear in the service
A report that refreshes in Desktop but fails after publishing usually has a service-side cause.
| Symptom | Likely cause | Fix |
|---|---|---|
| Local file refresh fails in the service | No gateway can reach the file | Install an on-premises data gateway and add the data source |
| Gateway shows offline | The gateway machine is off, or the service is stopped | Restart the gateway service and confirm the machine is on |
| SharePoint Online refresh fails with invalid credentials | The stored OAuth token expired | Edit the dataset's data source credentials and sign in again |
| Refresh works, but values are stale | The refresh schedule is disabled or failed several times | Check refresh history and re-enable the schedule |
Check the dataset's Refresh history first. It gives the error code and the time of the failure. Compare it against the table above.
A quick checklist
- Read the full error text, not only the first line.
- Find which applied step fails by clicking through the steps.
- Confirm that the path or URL still works, and that parameters hold the right values.
- Clear and re-enter credentials in Data source settings.
- Check privacy levels if the message mentions the firewall.
- In the service, check the gateway status and the refresh history.
Exercise
A report refreshes correctly in Power BI Desktop. After you publish it, the scheduled refresh fails. The report reads C:\Data\orders.csv and has no gateway configured. What is the cause, and what do you do?
Show answer
The Power BI service cannot reach a file on a local drive. Install an on-premises data gateway on a machine that can read the file, add the data source in the dataset settings, and map the dataset to the gateway. Alternatively, move the file to SharePoint Online and change the query to read it from there, which needs no gateway.
Exercise
A refresh fails with "Column 'Amount' of the table wasn't found" after a colleague edited the workbook. Which link of the refresh chain failed, and what is your first check?
Show answer
The applied steps link failed, because the data arrived but a later step references a column that is gone. Open the Navigation or source step and check whether the column was renamed or removed. Then correct the header in the workbook, or update the step that uses the name.