databricks-metric-views

Define and manage YAML-based business metrics in Databricks Unity Catalog.

Updated Apr 18, 2026
One-click install
npx skills add https://github.com/aaronachermann/PolentaEncoders --skill databricks-metric-views-aaronachermann
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databricks-metric-views
Source: https://github.com/aaronachermann/PolentaEncoders/tree/main/.github/skills/databricks-metric-views
Command: npx skills add https://github.com/aaronachermann/PolentaEncoders --skill databricks-metric-views-aaronachermann

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a single, governed YAML-based layer to define, create, query, and manage business metrics so teams avoid inconsistent KPI definitions, duplicated aggregations, and fragile SQL logic across dashboards and analytics tools.

Core Features & Use Cases

  • Define reusable metric views in YAML that separate measure expressions from dimension definitions for flexible querying and safe re-aggregation.
  • Support complex aggregations (ratios, filtered measures, distinct counts), window measures (running totals, trailing windows, YTD), and star/snowflake joins for robust dimensional modeling.
  • Enable optional materialization for pre-computed aggregations, and use MCP tooling to create, alter, query, describe, drop, and grant access to metric views in Databricks Unity Catalog.

Quick Start

Create a metric view named catalog.schema.orders_metrics that defines display dimensions and aggregated measures from catalog.schema.orders and then query it using MEASURE() in your SQL warehouse.

Frequently Asked Questions about databricks-metric-views

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

FAQPage Schema
How do I standardize business KPIs in Databricks to avoid inconsistent metric definitions across dashboards?

Standardize business KPIs in Databricks by defining governed metric views in YAML. This separates measure expressions from dimensions, ensuring consistent aggregations and preventing duplicated SQL logic across BI tools.

How do I create and query governed metric views in Databricks Unity Catalog?

Create governed metric views in Databricks Unity Catalog by defining aggregated measures and display dimensions in YAML. Query them using MEASURE() semantics in your SQL warehouse to retrieve standardized data.

Can I use YAML to define complex aggregations and window measures for Databricks SQL?

Yes, YAML supports defining complex aggregations for Databricks SQL, including ratios, filtered measures, distinct counts, and window measures like running totals, trailing windows, and YTD calculations for robust dimensional modeling.

Do I need a specific Databricks Runtime version to manage metric views with YAML?

Yes, managing metric views with YAML requires Databricks Runtime 17.2 or later for YAML v1.1 support. You also need appropriate SQL warehouse permissions, including SELECT, CREATE TABLE, and USE SCHEMA.

What is the best way to pre-compute aggregations for Databricks metric views?

The best way to pre-compute aggregations for Databricks metric views is to enable optional materialization. This stores pre-computed results in Unity Catalog, optimizing query performance for heavy analytical workloads.

How do I grant access to Databricks metric views defined in YAML?

Grant access to Databricks metric views defined in YAML using MCP tooling. This allows you to manage permissions alongside creating, altering, describing, and dropping metric views within Unity Catalog.