Semantic Layer 3 min read

Metrics Layer

Last updated: 2026-04-15

A metrics layer is a centralized system for defining, computing, and serving business metrics consistently across every tool in the data stack. It stores the canonical definition of each metric – the aggregation logic, the filters, the grain, the dimensional relationships – and exposes those definitions to any downstream consumer: BI dashboards, notebooks, AI interfaces, reverse ETL pipelines, or custom applications.

The metrics layer is the metric-specific subset of a broader semantic layer. Where the semantic layer encompasses all business logic – dimensions, relationships, access controls, entity definitions – the metrics layer focuses narrowly on metric definitions and their computation. Every metrics layer is part of a semantic layer, though some semantic layers lack a well-defined metrics layer.

Why it emerged

Metric inconsistency across tools drove the creation of dedicated metrics layers. In a typical data stack circa 2020, "revenue" might be defined in a Looker Explore, reimplemented in a dbt model, redefined in a Python notebook, and approximated in a Google Sheet. Each definition used slightly different filters, join logic, or time-window handling. The result: different tools showed different numbers for the same metric, eroding trust in data across the organization.

The metrics layer emerged as a response. Define "revenue" once. Every tool queries that definition. Changes propagate everywhere. Disagreements disappear because there is only one calculation to disagree about.

Tools that implement it

Several approaches exist, each with distinct tradeoffs:

Standalone metrics layers. dbt Metrics (now dbt Semantic Layer powered by MetricFlow) and Cube define metrics in a configuration layer that sits between the warehouse and consumption tools. They expose metrics via API, which downstream tools consume. The metrics layer is decoupled from any specific front-end.

BI-native semantic layers. Looker (LookML), Power BI (DAX/Tabular model), and Holistics (AML) embed metric definitions inside the BI tool itself. The semantic layer and the consumption layer are tightly integrated. Metrics are defined, governed, and consumed within the same platform.

Warehouse-native approaches. Some teams define metrics directly in dbt models or SQL views, then expose them to BI tools as pre-computed tables. This is less a metrics layer and more an engineering pattern – but it solves the same problem of metric consistency, at the cost of flexibility and composability.

The integrated vs. middleware debate

The central architectural tension is whether the metrics layer should live inside the BI tool or as a standalone middleware service.

The middleware argument: A standalone metrics layer serves every consumer equally. Notebooks get the same metric definitions as dashboards. AI agents get the same definitions as embedded analytics. No single tool owns the metric. This matters in organizations where multiple BI tools coexist or where non-BI consumers – data science, ML pipelines, operational systems – need governed metrics.

The integration argument: A metrics layer tightly coupled to a BI tool can optimize the full path from definition to visualization. The BI engine understands metric semantics, can push computation down, can validate queries against metric definitions before they execute. Middleware layers introduce latency, API boundaries, and synchronization complexity. And in practice, most metrics are consumed through a BI tool – making the integration benefits concrete and the middleware benefits theoretical for many organizations.

The right answer depends on consumption patterns. Organizations with a single primary BI tool and limited non-BI metric consumption benefit from integration. Organizations with a fragmented tool stack or heavy programmatic metric access benefit from middleware.

Metrics layer and the business glossary

A metrics layer overlaps with but differs from a business glossary. A business glossary defines what terms mean in plain language – "MRR is the sum of all active subscription amounts at month-end." A metrics layer defines how to compute them – the specific aggregation, the filter conditions, the join path, the grain handling.

The glossary is documentation. The metrics layer is executable. Both are necessary. The glossary helps humans agree on meaning. The metrics layer ensures that every computation matches that agreed-upon meaning.

Organizations that maintain a business glossary without a metrics layer often find that the glossary and the actual computations drift apart. The glossary says "revenue excludes refunds." The SQL in three dashboards includes refunds. Nobody notices until a quarterly review surfaces a discrepancy. A metrics layer eliminates this drift by making the definition both human-readable and machine-executable.

The Holistics Perspective

In Holistics, the metrics layer and semantic layer are the same system. Metrics defined in AML are the governed source of truth for dashboards, embedded analytics, AI queries, and API consumers. There is no separate middleware metrics layer sitting between the warehouse and the BI tool.

See how Holistics approaches this →