A metrics layer is where business metrics are defined once, usually as code, so every tool computes them the same way. A semantic layer includes a metrics layer and adds the rest of the business vocabulary (entities, dimensions and how they join), the interfaces that BI tools and AI agents use, and governance such as access rules. In short: every semantic layer has a metrics layer inside it; a metrics layer on its own is a narrower thing.
Side by side
| Metrics layer | Semantic layer | |
|---|---|---|
| Defines | Metrics: formula, filters, time dimension, allowed dimensions | Metrics plus entities, relationships, dimensions, hierarchies, descriptions |
| Main users | Analytics engineers, BI tools | BI tools, applications, analysts, AI agents |
| Typical home | Transformation project (YAML in Git) | A dedicated service, a BI tool or the warehouse |
| Interfaces | API or integrations for BI | SQL, APIs, MDX/DAX, MCP for agents |
| Governance | Versioning and review in Git | Also access rules, row-level security, masking, audit |
Where the term metrics layer came from
The phrase became popular around 2021, when modern data stack teams noticed that the same metric was being rewritten in every dashboard tool. Tools such as Transform's MetricFlow and dbt's metrics proposed defining metrics as code next to the transformations. dbt Labs later acquired Transform, and MetricFlow became the engine of the dbt Semantic Layer. The name change from "metrics layer" to "semantic layer" reflects the scope growing beyond metrics alone.
What a metric definition contains
Whichever term you use, a governed metric should state:
- Name and description:
net_revenue, "Revenue after discounts, excluding refunded orders." - Formula:
sum(line_amount) - sum(discount_amount). - Filters:
order_status != 'refunded'. - Time dimension: order date.
- Valid dimensions: region, product category, channel.
- Type: simple, ratio, cumulative or derived. See how to define metrics in a semantic layer.
- Owner: who approves changes.
What governed metrics means
"Governed metrics" means the definitions are owned, reviewed and versioned, and that consumers can only use the approved version. In practice: changes go through review, every metric has an owner, conflicting definitions are resolved explicitly, and queries are logged. Governance is what turns a list of formulas into numbers the business trusts.
Universal semantic layer vs metrics layer
A universal semantic layer is a semantic layer that serves every tool from one place. Compared with a metrics layer, it adds the interfaces for many BI tools and agents, the entity model for joining across processes, and governance in one place. If you only need consistent metrics for one or two BI tools and your team lives in dbt, a metrics layer may be enough. If AI agents, Excel, several BI tools and access rules are involved, you need the wider semantic layer.
Which do you need?
- A metrics layer is enough when a small data team defines metrics for one or two well-integrated BI tools.
- You need a semantic layer when several tools and AI agents query the same definitions, when non-engineers need to explore by entity and dimension, or when access rules and masking must apply consistently.
Frequently asked questions
Is a metrics layer the same as a semantic layer?
No. A metrics layer is the part of a semantic layer that defines metrics. A semantic layer also defines entities and relationships, and provides interfaces and governance.
Is the dbt Semantic Layer a metrics layer?
It grew out of one, and metrics are its core. It also includes semantic models with entities and dimensions, so it is fair to call it a semantic layer.
Can a metrics layer serve AI agents?
It can provide definitions, but agents also need to know entities, relationships and descriptions, and need access rules applied to their queries. That is the job of the wider semantic layer or a context layer. See context layer for AI agents.
Define metrics on a validated model
offdataai defines metrics as part of an ontology derived from your data model, so every metric is bound to concepts and tables that have been checked for grain and joins. Definitions export to dbt MetricFlow YAML as well as Snowflake semantic views and Databricks metric views. See the semantic layer.
