metricsign
Start free
Low severityschema

Power BI Refresh Error:
4104

What does this error mean?

A multi-part identifier (e.g. schema.table.column) in the query cannot be resolved — one of the parts does not exist or is ambiguous.

Common causes

  • 1A query uses a four-part name (server.database.schema.object) but the linked server or database does not exist
  • 2A column alias is used in a WHERE or GROUP BY clause where it is not yet resolved
  • 3A JOIN uses table.column notation but the table alias is defined differently

How to fix it

  1. 1Step 1: Check the exact identifier in the error message and verify each part exists: SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'schema' AND TABLE_NAME = 'table' AND COLUMN_NAME = 'column';
  2. 2Step 2: For column aliases used in WHERE, move the logic to a subquery or CTE — aliases are not available in WHERE: SELECT * FROM (SELECT col * 2 AS doubled FROM t) sub WHERE sub.doubled > 10;
  3. 3Step 3: Verify linked server names: SELECT * FROM sys.servers; — if the four-part name references a missing linked server, add it or rewrite the query.

Frequently asked questions

Why can't I use a column alias in a WHERE clause?

SQL Server evaluates WHERE before SELECT in its logical query processing order, so aliases defined in SELECT are not yet available. Use a CTE or subquery to apply filters on aliases.

Can dbt cause error 4104?

Yes — if a dbt model uses a ref() or source() that resolves to a different schema than the query expects, or if a Jinja template generates a malformed identifier.

How do I check if a linked server is accessible?

Run: EXEC sp_testlinkedserver 'linked_server_name'; — returns success or a specific error indicating why the linked server is not accessible.

Official documentation: https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-events-and-errors

Other schema errors