What is a governed metric layer for AI and BI?
Summary
- A governed metric layer is the place in your data platform where business metrics are defined once, as catalog objects with permissions, lineage and owners, so dashboards, SQL users and AI agents all compute a KPI the same way.
- It separates what you measure (measures such as revenue per customer) from how you slice it (fields such as region or order month), so one definition answers any grouping a person or an agent asks for.
- Defining metrics at the data layer, not inside one BI tool, means the definition reaches every consumer and inherits the data's access controls.
- On Databricks, the governed metric layer is Unity Catalog metric views. Databricks announced Unity Catalog Business Semantics, with metric views at its core, as generally available, and Apache Spark 4.2.0 added metric views to open-source Spark SQL.
- For AI, the layer also needs agent-facing metadata. Metric views store display names, synonyms and formats next to each definition.
What is a governed metric layer for AI and BI?
A governed metric layer is the part of your data platform where business metrics are defined once, as governed objects, and served to every dashboard, query and AI agent. "Governed" is the important word. The definitions carry the same permissions, lineage and ownership as the data, so a KPI can't quietly fork into a different version in every tool. For AI, it's the difference between an agent guessing how to calculate net revenue and one using the calculation finance approved. On Databricks, that layer is Unity Catalog metric views.
What is a metric layer?
A metric layer, often called a semantic layer, sits between raw tables and the people and tools asking questions. It holds measures (aggregations such as total revenue), dimensions or fields (the attributes you group and filter by), and the joins and filters that connect them.
The difference from a standard view matters. A standard view locks in aggregations and groupings when you create it. A metric view keeps the measure definition separate, so users can group by any available field and the query engine generates the correct computation.
For years, these definitions lived inside individual BI tools. As Databricks' GA announcement puts it, layers at the presentation tier leave teams redefining the same metrics for different dashboards and reports, and agents inherit that fragmentation.
What makes a metric layer governed
| Capability | Why it matters |
|---|---|
| Definitions as code in the catalog | Every consumer resolves the same definition of each KPI |
| Access control on the metric | Who can query or edit a metric is managed like any table or view |
| Lineage | You can see which dashboards and queries depend on a metric before you change it |
| Clear ownership | A named owner or group is accountable for each definition |
| Certification | People and agents can tell vetted metrics from drafts |
| Agent-facing metadata | Synonyms, display names and formats help AI map a question to the right measure |
| Open, SQL-based access | BI tools, notebooks and agents query the same object over standard SQL |
| Query acceleration | Pre-computed aggregations keep governed metrics responsive on dashboards |
How Databricks approaches a governed metric layer
The docs describe metric views as "the core implementation of Unity Catalog semantics".
- Define once. Create a metric view with SQL DDL (
CREATE VIEW ... WITH METRICS LANGUAGE YAML) or the Catalog Explorer editor. The YAML holds asource,fields,measures, and optional multi-leveljoinsand afilterapplied to every query. Window measures support windowed, cumulative and semiadditive aggregations. - Query anywhere with
MEASURE(). All measure evaluations in a metric view query use theMEASUREaggregate function. Query from SQL editors, notebooks, AI/BI Dashboards, Genie Agents, alerts and external BI tools. - Govern like any securable. Metric views use the same hierarchical permission model as other Unity Catalog objects, so
GRANT SELECTworks as it does on a view. Only the owner edits the definition, and transferring ownership to a group enables collaborative editing. The Lineage tab shows downstream dependencies. - Signal trust. The
system.certification_statustag marks a metric viewcertifiedordeprecated. - Describe for AI. Agent metadata adds
display_name,synonymsandformatto fields and measures (it requires Databricks Runtime 17.3 and YAML version 1.1). AI/BI Dashboards populate display names and formats automatically, and Genie Agents import the synonyms. - Stay fast. Materialization uses materialized views to pre-compute aggregations, and the optimizer routes eligible queries to them without changes to the query.
- Stay open. Metric views are also in open-source Apache Spark: the Spark 4.2.0 release notes list metric views as declarative semantic modeling with a
CREATE VIEW ... WITH METRICSsurface.
How AI and BI share one layer
- Dashboards. AI/BI Dashboards built on metric views compute KPIs from the governed definition.
- Conversational analytics. Databricks' Genie Agent guidance says metric views are particularly effective for Genie Agents because they pre-define metrics, dimensions and aggregations.
- Custom agents and apps. Because each metric is defined declaratively, the engine compiles the SQL deterministically at query time, so a human or an agent gets the same result from the same definition.
- Existing BI models. Genie Code's
/importBIskill imports a data model from a partner BI tool into Databricks.
FAQs
Do I have to copy data into a metric layer?
No. A metric view's source is a table-like Unity Catalog asset or a SQL query, so the definition sits on top of data you already govern.
Why does a metric layer matter for AI agents?
An agent asked about revenue needs the approved calculation, not a guess. A governed metric layer gives it one definition, plus synonyms that map everyday words to the right measure, under the asker's own permissions.
Can external BI tools use Unity Catalog metric views?
Yes. Any tool with a SQL connection can query them with MEASURE(), through a wrapper view, or through BI compatibility mode, which rewrites standard aggregations to apply the correct measure logic.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.