MetricSign
EN|NLRequest Access
High severitycompilation

Power BI Refresh Error:
DbtSemanticModelEntityMappingError

What does this error mean?

A dbt semantic model definition contains an invalid entity mapping, preventing MetricFlow from understanding how to join measures across semantic models.

Common causes

  • 1An entity column referenced in the semantic model does not exist in the underlying dbt model
  • 2Two semantic models declare incompatible entity types for the same join key
  • 3A foreign key entity references a primary key that is not declared in any other semantic model
  • 4The entity type (primary, foreign, unique, natural) is incorrectly assigned

How to fix it

  1. 1Step 1: Run dbt parse to see the full entity mapping validation error.
  2. 2Step 2: Verify the entity column name exists in the underlying dbt model's output schema.
  3. 3Step 3: Check that entity types are consistent — a primary key in one semantic model must be referenced as a foreign key in models that join to it.
  4. 4Step 4: Use dbt ls --select tag:semantic_models to list all semantic models and trace the entity chain.
  5. 5Step 5: Refer to the MetricFlow entity documentation to confirm correct entity type assignments.

Frequently asked questions

What are the four entity types in dbt MetricFlow?

Primary (unique row identifier in this semantic model), foreign (references another model's primary entity), unique (unique but not a primary entity), and natural (a column with business-meaning uniqueness). Primary entities are required for joining.

Can a semantic model have multiple entities?

Yes — semantic models can have multiple entities, but only one primary entity. Multiple foreign entities allow joins to several other semantic models.

Other compilation errors