Define a MetricFlow semantic model in YAML with primary, foreign, and unique entity types to enable automatic join resolution

domain: docs.getdbt.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a YAML file alongside your dbt model and add a semantic_models block with a name, model ref, and description
  2. Under entities, declare one primary entity (type: primary) with the column that uniquely identifies each row, then add foreign entities (type: foreign) referencing join keys to other semantic models
  3. Add a unique entity (type: unique) for columns that are unique per row but are not the primary key of the semantic model when needed
  4. Define measures with agg (e.g., sum, count_distinct) and dimensions with type: categorical or type: time to complete the semantic model
  5. Run dbt parse and then dbt sl list metrics to confirm MetricFlow resolves the semantic graph without errors

Known gotchas

Related routes

Author a MetricFlow conversion metric in YAML to track funnel conversion rates between two events
docs.getdbt.com · 5 steps · unrated
MLflow model registry: register a model and transition stage
mlflow.org/docs · 6 steps · unrated
Assign and query MLflow registered model aliases to replace deprecated stage transitions
mlflow.org/docs · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans