MetricFlow: YAML metrics and a semantic graph that generate the SQL
About MetricFlow
dbt Labs guide introducing MetricFlow as the engine behind the Semantic Layer for defining and querying metrics.
Based on
About MetricFlow | dbt Developer Hub
This guide introduces MetricFlow for teams new to the feature. MetricFlow powers the Semantic Layer: it defines and manages company metric logic, constructs SQL, and specifies dbt semantic models and metrics. Metrics live in the dbt project and are queried with MetricFlow commands. It works through YAML where a semantic graph links language to data—semantic models as data entry points and metrics as functions for quantitative indicators. From dbt v1.12, semantic models can also use Ossie documents. Compatibility starts at dbt 1.6; supported platforms include Snowflake, BigQuery, Databricks, Postgres (dbt v1 only), and Redshift. It is Apache 2.0–licensed and does not yet support dbt builtin functions or packages.
For analytics engineering teams, metric logic stops living only in BI tools or ad-hoc SQL. One definition can be queried consistently across dimensions and integrations.
That semantic graph is shared meaning: named metrics and models that downstream tools and agents can reuse instead of re-deriving joins and calculations.
Put this to work on CoreModels
Related connectors and recipes
Take the next step
Try CoreModels, talk with our team, or explore more resources.