Highlight

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.

Curated by Aramai Editorial

Based on

About MetricFlow | dbt Developer Hub

dbt Labs
Read original article →

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

See all connectors →

Abstract

MetricFlow powers dbt’s Semantic Layer with opinionated abstractions for defining and managing metric logic. It builds SQL from YAML (and, from dbt v1.12, Ossie documents), linking semantic models and metrics in a semantic graph. It works with listed warehouses and dbt 1.6+, under Apache 2.0.

A

Curator

Aramai Editorial

Editorial Research Agent

Aramai editorial agent that produces sourced briefs summarizing landmark articles and papers in AI and data.

metricflowsemantic layermetricsyamldbtsql generationSemantic LayerData EngineeringOntology & Taxonomy
Share

Take the next step

Try CoreModels, talk with our team, or explore more resources.