[Excel/Power Query] Error: Expression.Error — The name wasn’t recognized — Did you mean...? (missing name or function) — How to Fix It

Summary

Expression.Error: The name wasn’t recognized — Did you mean...? occurs when Power Query cannot find a query, function, or variable referenced in your M code. It usually happens after renaming or deleting a query, typing a name incorrectly, or calling a function with wrong capitalization. Because Power Query’s M language is case-sensitive and doesn’t auto-update dependencies, even small spelling differences can break formulas. The fix is to correct the reference name, confirm that the query or function exists, or reestablish a missing link.

Context

This error appears both in the Power Query Editor and during data refresh. When you rename a query in the Queries pane, dependent queries that reference it (e.g., Source = Query1) don’t automatically update. Similarly, function names like Text.Combine must be written exactly as defined — text.combine won’t work. The editor tries to help by suggesting “Did you mean…?” if a similar name exists. Fixing this requires verifying all references, respecting case sensitivity, and checking that all required queries or parameters are loaded and accessible.

Probable Cause

  • Renamed or deleted query: The reference name no longer matches an existing query.
  • Typo or case mismatch: Power Query function names are case-sensitive (e.g., Text.Fromtext.from).
  • Unavailable function or variable: You referenced a function that doesn’t exist in your M environment.
  • Broken external reference: A parameter or source file path points to a missing query or table.
  • Step renamed inside query: A step used downstream (e.g., “Changed Type”) was renamed or removed.

Quick Fix

  1. Find the failing step: Open Power Query Editor and look for a red-highlighted step in the Applied Steps pane.
  2. Check referenced names: Verify the exact spelling and capitalization of all queries, steps, and functions used in that line.
  3. Ensure the query exists: Look for it in the left Query pane — it must be loaded or at least visible.
  4. Use quoted syntax for names with spaces: e.g., #"Sales Data" instead of Sales Data.
  5. Validate function names: Refer to official documentation for case-sensitive M function names (e.g., Text.Combine, Record.Field, List.Transform).
# Example: broken reference due to rename let Source = Query1 in Source # Fix — update reference to new query name let Source = #"Query 1 Updated" in Source 
  1. Recreate missing queries if deleted: Restore them from backup or by reimporting the data source.
  2. For missing steps inside queries: Check the formula bar for outdated step names and update manually.

Full Example

Scenario: You renamed “Customer_Data” to “Customers” in the Queries pane, but another query still references the old name.

# Before rename let Source = Customer_Data, Filtered = Table.SelectRows(Source, each [Active] = true) in Filtered # After rename → Error: The name 'Customer_Data' wasn’t recognized. Did you mean 'Customers'? # Fix let Source = Customers, Filtered = Table.SelectRows(Source, each [Active] = true) in Filtered 

Scenario 2 — Function typo:

# Wrong capitalization let Output = text.combine({"A", "B"}) in Output # Error → The name 'text.combine' wasn’t recognized. Did you mean 'Text.Combine'? # Fix let Output = Text.Combine({"A", "B"}) in Output 

Pitfalls & Debug

  • Symptom → Power Query suggests “Did you mean…” after a name. Fix → Verify spelling and capitalization of functions or queries.
  • Symptom → Refresh fails after renaming a query. Fix → Update all downstream queries referencing the old name.
  • Symptom → Missing function in custom code. Fix → Check version compatibility or load the correct function module.
  • Symptom → Formula references invisible query. Fix → Ensure it’s loaded or re-enabled under Query Properties → Enable Load.

Verification & Next Steps

# List all loaded queries = Excel.CurrentWorkbook()
Check dependencies visually

View → Query Dependencies → identify missing or broken links

Once fixed, refresh all queries to confirm no downstream dependencies are broken. For shared projects, keep a naming convention (e.g., underscores instead of spaces) to minimize dependency errors.

Sources

Microsoft Docs — Power Query M reference

View Query Dependencies

Identifiers and case sensitivity in M

Labels

Tool/Power Query, OS/Cross-platform, Topic/Query Name & Function Resolution