PATTERN Cited by 1 source
Governed metric as headless-BI substrate¶
Pattern¶
Define each business metric once as a first-class object in
the data platform's catalog (governance plane), with its measure
logic, dimensional join graph, and AI-grounding metadata
(display_name / comment / synonyms). Have every consumer
— first-party BI dashboards, AI agents, SQL notebooks, third-party
BI tools — resolve the same definition through a uniform
tool-agnostic contract (e.g. MEASURE(metric_name)).
The pattern resolves the per-tool semantic layer drift failure mode by collapsing N tool-specific metric definitions into one governed primitive that lives in the same catalog as the underlying data, so governance + lineage + audit + AI grounding all flow through it uniformly.
Forces¶
- Definitional drift across BI tools when revenue is computed in LookML, Tableau, Power BI, and SQL notebooks separately.
- Governance gaps when each per-tool semantic layer has its own access control surface.
- AI agent ambiguity when an LLM has to guess which
revenuedefinition to use. - Refactoring cost when the metric logic changes — every BI tool's definition has to be updated.
- Cost-attribution opacity when each tool runs its own aggregation pipeline and the bill is fragmented.
Solution shape (verbatim from the source)¶
"Metric Views in Unity Catalog solve this by providing a headless BI layer — a single, governed semantic layer where you define your data model and KPIs once, independent of any specific BI tool. […] AI/BI Dashboards, Genie, SQL notebooks, and third-party BI tools all resolve metrics from the same definitions. Define a metric once, and every consumer — human or AI — gets the same answer."
Three structural moves:
- Move the metric definition into the data platform's catalog. Not into the BI tool's semantic layer. The catalog (e.g. Unity Catalog) is where governance, lineage, and access control already live.
- Make the resolution contract tool-agnostic. A uniform
MEASURE()SQL function (in Databricks) or equivalent abstraction in other systems. Every consumer that can issue SQL can resolve the metric. - Capture semantic metadata with the definition, not separately.
display_name/comment/synonymslive in the same object as the SQL logic, so AI agents can reason over the metric without per-tool prompt scaffolding.
Concrete steps¶
- Identify a metric that's currently defined in multiple places (revenue, MAU, retention, NPS).
- Pick the canonical SQL definition by negotiation with the business owner.
- Create a Metric View in Unity Catalog with measure logic + dimensions + grain.
- Annotate
display_name,comment, andsynonymsfor AI grounding. Be generous with synonyms — "sales", "top line", "ARR" are all valid alternates for "revenue" depending on context. - Point one consumer at the new Metric View first (low-risk — start with a SQL notebook or a single dashboard widget).
- Verify the numbers match the legacy definition.
- Migrate the next consumer.
- Once all consumers resolve through the Metric View, retire the legacy per-tool definitions.
Trade-offs¶
| Choice | Implication |
|---|---|
| Catalog-resident metric definition | Governance is uniform; refactor cost drops to one place. |
MEASURE() resolution contract |
Locks consumers to engines that support the contract; third-party tools need a connector. |
| Generous synonyms metadata | AI grounding works well; some semantic ambiguity (does "sales" mean revenue or units?) needs disambiguation logic. |
| Catalog as governance plane | Per-team metric ownership requires governance processes — without them, the headless layer just moves the drift inside the catalog. |
Where this shows up on the wiki¶
- systems/databricks-metric-views — canonical instance.
- systems/databricks-genie — agent consumer (the source of the "any agent with access to Unity Catalog can discover and query governed metrics" claim).
- concepts/headless-bi-semantic-layer — the generalised concept.
- concepts/layered-grounded-context-for-data-agent — the AI-grounding sibling pattern from Cloudflare Skipper, where metric metadata + DataHub glossary terms together form the grounded context an agent reasons over.
Failure modes¶
- Thin semantic metadata. A Metric View with empty
synonymsand a perfunctorycommentwon't ground AI agents well — the headless win on the AI side is proportional to metadata richness. - Metric ownership ambiguity. Without process, two teams
define
revenuetwo ways inside the catalog itself. The pattern prevents drift across consumers but not across producers. - Materialization-or-not coupling. If the metric resolution always falls back to base-table compute (no materialization), performance can be worse than the per-tool aggregate-table shape it replaces. Mitigation: pair with patterns/auto-materialized-aggregation-via-semantic-layer.
- Tool support gap. Third-party BI tools that don't natively
understand
MEASURE()need a connector or live SQL pass- through. The headless win is bounded by integration coverage.
Sibling patterns¶
- patterns/auto-materialized-aggregation-via-semantic-layer — composes with this pattern to give the metric performance
- governance + AI grounding in one primitive.
- The MDM-domain cousin: Zalando's concepts/semantic-layer-of-business-concepts — same structural shape (a definitional layer in the platform that decouples downstream consumers from upstream sources), at a different granularity (master data vs business metrics).
Seen in¶
- sources/2026-05-27-databricks-bi-serving-pointers-maximizing-for-performance-and-tco — first wiki canonicalisation as a pattern. Names the four-consumer surface (AI/BI Dashboards / Genie / notebooks / third-party BI), the open-standard provenance (SPARK-54119), and the AI-grounding-via-semantic-metadata shape. Reserved for future ingests: cross-vendor consumption stories, the metric-resolution wire protocol, federation across multiple semantic layers.
Related¶
- systems/databricks-metric-views — the canonical instance.
- systems/unity-catalog — the governance plane.
- systems/databricks-genie — one consumer surface.
- concepts/headless-bi-semantic-layer — the generalised concept.
- concepts/layered-grounded-context-for-data-agent — the AI-grounding sibling concept.
- patterns/auto-materialized-aggregation-via-semantic-layer — composes with this pattern.