If Power Query is misbehaving, the fastest fix is almost always to open the query in the Power Query Editor and look at the Applied Steps list on the right-hand side. Click through the steps from top to bottom until the preview goes wrong: the step just before it is usually the culprit, and deleting or editing that step fixes most load, refresh and type errors. Power Query is the data preparation engine inside Excel, Power BI Desktop, and some Microsoft 365 tools, so the same habits apply in all of them. The steps below cover how to get help from the built-in error messages, how to repair a broken query, and how to keep future refreshes from failing.

What You'll Need

  • Excel (Microsoft 365 desktop version, or Excel 2016 and later), Power BI Desktop, or another Microsoft tool that includes Power Query. Power Query in Excel for the web is limited, so use the desktop app for editing queries.
  • The source file, folder, database, or web address your query connects to, plus any sign-in details it needs. For SharePoint, OneDrive, and database sources you may need to re-authenticate.
  • A backup copy of your workbook or report file before you start deleting steps or changing source settings.
  • Access rights to the source. Many "help" requests turn out to be permission problems rather than formula problems.

Step-by-Step

  1. Read the error message properly. When a query fails to refresh, Excel or Power BI shows a message with an error code and sometimes a file path or column name. Note it down. In Excel, open Data > Queries & Connections and hover over or right-click the failing query to see more detail; in Power BI Desktop, open the Refresh history or click See details next to the error. Menu labels differ slightly by version and platform.
  2. Open the Power Query Editor. In Excel, select a cell inside the loaded table, then go to Data > Queries & Connections and double-click the query, or use Data > Get Data > Launch Power Query Editor. In Power BI Desktop, choose Transform data on the Home ribbon. Never edit a query by changing the output table by hand; the next refresh overwrites it.
  3. Find the failing step. In the Applied Steps pane (on the right in both Excel and Power BI), click each step from the first one down. When the preview stops matching the source or shows Error in cells, the step you just clicked is the problem. Right-click the step and choose Properties to read it, or click the small gear icon beside Source and Changed Type steps to see their settings.
  4. Check the source first. Most errors come from the source changing, not the query. Confirm the file still exists at the same path, the folder still contains the file, the sheet or table name has not been renamed, column headers have not been reworded (including stray spaces and capital letters), and the web page or API still responds. If a step says a column was not found, the source header probably changed.
  5. Fix the broken step or remove it. If a step names a column that no longer exists, delete that step and rebuild it from the current column. To delete, right-click the step and choose Delete; to rename a column reference, edit the step's formula in the formula bar instead of clicking the gear icon, then press Enter.
  6. Re-authenticate if it is a credential error. In Excel, go to Data > Get Data > Data Source Settings and check the permissions for the source; in Power BI Desktop, use File > Options and settings > Data source settings. Select the source, choose Edit Permissions or Clear Permissions, then sign in again. If your password or token changed, this is almost always the cause.
  7. Check data types before loading. Click the icon at the top-left of each column header to confirm the type (Text, Whole Number, Date). Type errors such as "We couldn't convert to Number" mean one row contains text or a blank where a number is expected. Either clean that value or change the column type to Text so the refresh succeeds.
  8. Close and load, then refresh. Choose Home > Close & Load (or Close & Apply in Power BI) to publish the fixed query. Run a fresh refresh to confirm the error is gone: Data > Refresh All in Excel, Home > Refresh in Power BI. If it still fails, reopen the editor and repeat from step 3.
  9. Get help from the source of truth. If you are still stuck, copy the exact error text and search Microsoft's official Power Query documentation or the Power Query section of the Microsoft support site. Include the connector name (for example Excel Workbook, Folder, SharePoint, SQL Server) and the failing step name. Community forums are useful, but prefer answers that quote official documentation.

Common Mistakes

  • Typing values into the loaded output table. The next refresh discards them. Add calculations as new steps in the query, or in a separate column outside the loaded range.
  • Renaming or moving the source file, sheet, or column without updating the query. Power Query remembers the old header text and old path exactly.
  • Hard-coding a folder path that only exists on your machine. Use the folder connector's relative options or a parameter so other people and scheduled refreshes can find it.
  • Ignoring Changed Type. Auto-generated type steps silently break when a column gains a blank or a text value. Set types deliberately and handle blanks first.
  • Stacking dozens of steps without renaming them. Give key steps readable names so you can find the broken one quickly.
  • Refreshing a cloud-scheduled query with credentials that only work on your desktop. Update the data source credentials in the service that hosts the refresh.

Tips

  • Keep a copy of the original file and a working version of the workbook; queries are hard to reconstruct from memory.
  • Use Refresh Preview in the Home tab after each change so you spot errors immediately instead of at close-and-load time.
  • Load a query to the Data Model or as Connection Only while testing; it loads faster than a full table.
  • Name your queries and steps clearly ("Sales_Raw", "Filter deleted rows") so a colleague can debug them later.
  • For recurring problems, add a column that tags the source file name or row number so you can trace bad rows back to their origin.
  • When combining files from a folder, make sure every file has the same headers. Extra or missing columns create nulls or errors on refresh.

Troubleshooting

Error: "The column 'X' of the table wasn't found." The source header changed or the file was replaced. Open the Source step, refresh the preview, and rebuild the step that references the missing column.

Error: "DataSource.Error" or "Access to the resource is forbidden." This is almost always credentials or permissions. Clear and re-enter permissions under Data Source Settings, and confirm the account has read access to the file, folder, or database.

Error: "We couldn't convert to Number/Date." Inspect the column for blanks, spaces, or text entries. Filter or replace them, then set the type again.

Refresh runs forever or crashes. A query is probably pulling far more rows than needed. Filter early, remove unneeded columns before merging, and avoid loading unnecessary tables to the worksheet or model.

Works on your PC, fails when scheduled. The scheduled refresh runs with the credentials stored online, not your desktop sign-in. Update them in the service, and check that the source is reachable from there.

If none of these help, and you are considering deleting the query and starting over: first save a copy of the file, because removing a query deletes every step and cannot be undone.

Frequently Asked Questions

Where do I find Power Query in Excel?

It is built in on the Data tab under Get Data, and the editor opens from Data > Queries & Connections or from the Get Data menu. Exact wording varies by Excel version and by whether the workbook is open in the desktop app or the browser.

Why does my query work in the editor but fail on refresh?

The editor preview may be cached. Click Refresh Preview, then close and load again. If it still fails, the source changed after the preview was taken or the stored credentials are stale.

Can I undo a deleted step?

In the Power Query Editor you can undo with the Undo button or Ctrl+Z while the editor is still open. Once you close and load, deleted steps are gone, so keep a copy of the file.

Does Power Query edit my source data?

No. Changes happen only inside the query; the source file or database is untouched. Only the query's output in the workbook or model changes.

Is Power Query the same in Excel and Power BI?

The engine is the same, so steps and formulas work the same way, but menu names and a few connector options differ slightly between the two apps.

Where should I ask for help if I'm still stuck?

Microsoft's official Power Query documentation and the Microsoft support community are the most reliable places. Share the exact error text, the connector, and the failing step name.