databricks-metric-views

Define governed business metrics in YAML with dimensions and measures.

1|Updated Dec 15, 2025
One-click install
npx skills add https://github.com/lucaslessachaves/default --skill databricks-metric-views-lucaslessachaves
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-metric-views
Source: https://github.com/lucaslessachaves/default/tree/main/.claude/skills/databricks-metric-views
Command: npx skills add https://github.com/lucaslessachaves/default --skill databricks-metric-views-lucaslessachaves

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unity Catalog metric views provide a way to define, manage, and standardize business metrics in YAML, separating measure logic from dimension groupings to enable governance and cross-team reuse.

Core Features & Use Cases

  • Define reusable metrics in YAML with dimensions, measures, joins, and an optional materialization block.
  • Support star and snowflake schema modeling, window measures, and filtered measures for flexible KPIs across dashboards and Genie.
  • Use cases include revenue KPIs, order analytics, and performance dashboards with consistent definitions across teams.

Quick Start

Create a metric view spec in YAML that declares version, source, and at least one dimension and one measure, then query the metric via MEASURE().

Frequently Asked Questions about databricks-metric-views

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

FAQPage Schema
How do I define governed business metrics in YAML for Databricks?

Unity Catalog metric views standardize business metrics in YAML by separating measure logic from dimension groupings, ensuring consistent KPI definitions across analytics workflows and cross-team reuse.

How do I query governed metrics using SQL in Databricks?

You query governed metrics in SQL using the MEASURE() function against your defined metric views. This allows you to apply standardized KPIs directly within BI dashboards, Genie, and SQL queries.

Does this YAML metric view approach support star and snowflake schema modeling?

Yes, Unity Catalog metric views support star and snowflake schema modeling. The YAML specification accommodates optional joins, window measures, and filtered measures for flexible KPI definitions.

What is the best way to standardize KPIs across multiple BI dashboards?

The best way to standardize KPIs is defining reusable metrics in YAML using metric-view specifications. Applying these metric views across BI dashboards, Genie, and SQL queries ensures consistent definitions across teams.

Can I materialize metric views defined in YAML?

Yes, you can materialize metric views by including an optional materialization block within your YAML specification. This works alongside dimensions, measures, and joins to optimize your analytics workflows.

Why use Unity Catalog metric views instead of writing native SQL queries for KPIs?

Unity Catalog metric views provide governance and reusable metrics by separating measure logic from dimension groupings. This ensures consistent KPI definitions across teams, unlike ad-hoc SQL queries that often lead to fragmented analytics.