[Excel/Power Query] Error: #REF! or Missing Table Reference — How to Fix Broken or Deleted Sources

Summary

The #REF! or “missing table” error in Power Query occurs when a referenced query, table, or external source no longer exists or has been renamed. Dependent queries may fail with Expression.Error messages or return blank results. To fix it, verify that all referenced queries are present, restore or rename deleted sources, and update connection paths. Works on Excel 2016+, Microsoft 365, and Power Query for Windows/Mac.

Context

Power Query builds dependencies between multiple queries, tables, and files. When one of these sources is deleted, renamed, or moved, any query depending on it fails with a #REF!-type issue or Expression.Error such as “The name 'Table1' wasn’t recognized.” These errors often appear after renaming queries, moving files to new directories, or importing workbooks from OneDrive/SharePoint. The Query Dependencies view helps visualize which queries depend on others and where the chain breaks.

Probable Cause

  • Deleted or renamed source query. Downstream steps reference a name that no longer exists.
  • External file moved. Power Query’s path reference becomes invalid after file relocation.
  • Sheet or table renamed in Excel. Queries referencing old names fail to resolve.
  • Connection corruption. Saved credentials or path info mismatch current workbook location.

Quick Fix

  1. Open Power Query Editor. Data → Get Data → Launch Power Query Editor.
  2. Inspect Applied Steps. Look for steps referencing deleted queries or tables:
    = Table.Combine({Query1, Query2})
    # → verify Query1 and Query2 still exist
    
  3. Recreate or rename missing queries. If a query was deleted, rebuild it or create a placeholder query with the same name.
  4. Update file paths. Go to Data Source Settings → Change Source and point to the correct file or folder.
  5. Use Query Dependencies view. View → Query Dependencies to identify disconnected queries.

Full Example

Scenario 1: Dependent query referencing a deleted table.

Expression.Error: The name 'SalesData' wasn't recognized. Make sure it's spelled correctly.

Fix: Restore or recreate the missing query:

# Create a new query called SalesData
SalesData = Excel.CurrentWorkbook(){[Name="SalesTable"]}[Content]

Then refresh the dependent query to re-establish the reference.

Scenario 2: Workbook moved to a different folder.

Expression.Error: The file wasn't found: 'C:\Reports\Budget.xlsx'

Fix: Update the data source path:

Home → Data Source Settings → Change Source → Browse → Select new file path

Scenario 3: Merge or append failing due to missing input.

= Table.Combine({Query1, Query2, Query3})
→ Expression.Error: The name 'Query2' wasn't recognized

Fix: Restore Query2 or remove it from the Table.Combine list if obsolete.

Pitfalls & Debug

  • Symptom → Query preview shows #REF! or empty results. Fix → Confirm all referenced queries exist and are loaded.
  • Symptom → “The name ‘Table1’ wasn’t recognized.” Fix → Check for renamed or deleted Excel tables.
  • Symptom → Refresh fails after moving workbook. Fix → Repoint file in Data Source Settings.
  • Symptom → Dependency graph shows broken links. Fix → Use View → Query Dependencies to locate and restore missing connections.
  • Symptom → Merge or append returns empty table. Fix → Verify both input queries return data before combination.

Validation & Next Steps

After fixing references, refresh all queries:

Home → Refresh Preview
Home → Close & Load → Refresh All

Use Manage Data Source Settings to reauthenticate credentials if needed. To prevent future breaks, use relative paths (with parameters or CurrentWorkbook() references) instead of hardcoded file paths, and keep query names stable across refactors.

Sources

https://learn.microsoft.com/en-us/powerquery-m/

https://support.microsoft.com/en-us/office/manage-data-source-settings

https://support.microsoft.com/en-us/office/power-query-query-dependencies-view

Labels

Tool/Power Query, OS/Cross-platform, Topic/Data Connections & References