databricks-metric-views

Define, create, and query governed Unity Catalog metric views in YAML on Databricks.

4|1|Updated May 22, 2026
One-click install
npx skills add https://github.com/ThomazRossito/ai-data-agents --skill databricks-metric-views-thomazrossito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: databricks-metric-views
Source: https://github.com/ThomazRossito/ai-data-agents/tree/main/plugins/ai-data-agents/skills/databricks-metric-views
Command: npx skills add https://github.com/ThomazRossito/ai-data-agents --skill databricks-metric-views-thomazrossito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams often redefine the same KPIs differently across dashboards, SQL queries, and notebooks, producing inconsistent numbers. This Skill creates Unity Catalog metric views that centralize business metric definitions in YAML so every tool and team queries the same governed measures and dimensions. ## Core Features & Use Cases - Metric View Authoring: Create metric views with dimensions, measures, filters, star/snowflake joins, window measures, and materialization using the YAML 1.1 spec on Databricks Runtime 17.2+. - Querying & Management: Query views with the MEASURE() function, describe definitions, grant access, convert existing SQL views, and drop views via SQL or the Databricks CLI. - Multi-Source Metric View Advisor: Build metric views from gold schemas, AI/BI dashboards, SQL query files, Genie spaces, or KPI spreadsheets, with overlap detection against existing views and a guided deploy flow. - Use Case: A data team formalizes revenue KPIs scattered across dashboards and ad-hoc SQL into a single governed metric view with Genie-friendly synonyms, so analysts, dashboards, and natural-language queries all return identical numbers. ## Quick Start Ask the AI to create a Unity Catalog metric view on your Databricks orders table with monthly revenue and order count measures, then query it by month.

Frequently Asked Questions about databricks-metric-views

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a metric view in Databricks Unity Catalog?▼

Create a metric view with CREATE OR REPLACE VIEW ... WITH METRICS LANGUAGE YAML, defining a source table, at least one dimension, and at least one measure in the YAML body. It requires Databricks Runtime 17.2+ for YAML version 1.1 and appropriate schema permissions.

How to query a Databricks metric view with SQL?▼

Query metric views by listing dimensions explicitly and wrapping every measure in the MEASURE() function, such as MEASURE(`Total Revenue`). SELECT * is not supported, and joins must be defined in the YAML rather than in the query.

What is the difference between a metric view and a standard SQL view?▼

Standard views lock aggregation at creation time, while metric views aggregate flexibly at query time and safely re-aggregate ratios. Metric views also support declarative joins, built-in materialization, and native AI/BI Genie integration.

Does Databricks metric views support window measures like running totals?▼

Yes, window measures are an experimental feature using a window block with order, range, and semiadditive fields. They support trailing windows, cumulative running totals, period-over-period growth, and year-to-date calculations, using YAML version 0.1.

Why does SELECT * fail on a Databricks metric view?▼

Metric views do not support SELECT * because measures must be explicitly wrapped in the MEASURE() function. List each dimension by name with backtick quoting for names containing spaces, and wrap every measure reference in MEASURE().

Can I build metric views from existing dashboards or Genie spaces?▼

Yes, the Metric View Advisor workflow analyzes gold schemas, AI/BI dashboards, SQL files, Genie spaces, or KPI files, merges them into deduplicated suggestions, checks overlap with existing views, and deploys the resulting metric views.