databricks-metric-views

Define and query governed Unity Catalog metric views using YAML specifications.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/AarushiShah/coding-agents-databricks-apps --skill databricks-metric-views-aarushishah
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-metric-views
Source: https://github.com/AarushiShah/coding-agents-databricks-apps/tree/main/.claude/skills/databricks-metric-views
Command: npx skills add https://github.com/AarushiShah/coding-agents-databricks-apps --skill databricks-metric-views-aarushishah

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Teams often redefine the same business metrics inconsistently across dashboards, SQL queries, and AI tools, leading to conflicting KPI numbers. This Skill standardizes metric definitions as governed Unity Catalog metric views so revenue, order counts, and ratios stay consistent everywhere. ## Core Features & Use Cases - YAML Metric Definitions: Create metric views with dimensions, measures, filters, joins, and materialization using the YAML 1.1 spec on Databricks Runtime 17.2+. - Advanced Measure Patterns: Build ratio measures, filtered measures with FILTER clauses, and window measures for moving averages, running totals, and period-over-period growth. - Star and Snowflake Schemas: Declare joins to dimension tables directly in the metric view, including nested snowflake hierarchies. - Use Case: Define an orders metric view with monthly revenue, fulfillment rate, and revenue-per-customer measures, then query it from SQL, AI/BI Dashboards, or Genie with consistent results. ## Quick Start Ask the agent to create a Unity Catalog metric view over your orders table with monthly revenue and order count measures, then query it grouped 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?

Use CREATE OR REPLACE VIEW with WITH METRICS LANGUAGE YAML, defining a source table, at least one dimension, and at least one measure with an aggregate expression. You can also call the manage_metric_views MCP tool with action create.

How do I query measures from a metric view?

Wrap every measure in the MEASURE() function, such as MEASURE(`Total Revenue`), and group by dimensions. SELECT * is not supported on metric views; you must explicitly list dimensions and measures.

What Databricks Runtime version do metric views require?

YAML version 1.1 requires Databricks Runtime 17.2 or later, while version 0.1 works on Runtime 16.4 through 17.1. Window measures currently use version 0.1 as an experimental feature.

Why does SELECT * fail on a metric view?

Metric views do not support SELECT * because measures must be explicitly wrapped in the MEASURE() function and dimensions listed by name. Names containing spaces also require backtick quoting.

Can metric views join fact and dimension tables?

Yes, declare joins in the YAML definition with a name, source table, and an on or using clause. Nested joins create snowflake schemas and require Databricks Runtime 17.1 or later.

When should I use a metric view instead of a standard SQL view?

Use metric views when you need flexible aggregation at query time, safe re-aggregation of ratios, declarative joins, built-in materialization, or native AI/BI Genie integration. Standard views lock aggregation at creation time.