Analytics

Metrics Layer Starter

Define each business metric once and use it in every report.

GIST stepGroundIterate
Download the PDF
What you get

The same number in every report, with a named owner for each metric.

Get the Metrics Layer Starter overview

The problem it solves, what is included, how it works, the technical components, and how we adapt it with you.

The problem

Every report has its own version of net sales.

Each dashboard rewrites the same metric in its own SQL. Numbers disagree between teams, meetings get spent reconciling them, and nobody can say which figure is right or who owns it.

What this accelerator does

The Metrics Layer Starter defines each metric once, with an owner and tests, and connects every report to that definition.

What's included

One definition per metric, with a named owner.

Four parts, each adapted to your data, platforms, and controls.

01

Metric definition templates

A short file per metric: what it counts, who owns it, how it may be sliced, and how it is tested.

02

Semantic model patterns

Sources, dimensions, and measures, with exports to the dbt Semantic Layer and Power BI.

03

Approval workflow

Certification by someone other than the owner, recorded against a fingerprint of the definition.

04

Reconciliation tests

Each metric checked against the system finance or operations already trusts.

You keep the definitions, the tests, the certification record, and the BI exports, versioned in your repository.

How it works

How it works.

  1. Models

    Say where data comes from, which column is the date, and which dimensions and measures exist.

  2. Metrics

    Simple, ratio, or derived metrics built on measures. Ratios compute after aggregation.

  3. Compiler rules

    A metric is sliced only by its allowed dimensions, never at a finer grain than defined.

  4. Tests

    Not null, range, dimensions sum to total, and reconciliation against a source figure.

  5. Certification

    Passes only when every test passes, dependencies are certified, and the certifier is not the owner.

  6. Change control

    Any edit changes the fingerprint and flags the metric until it is certified again.

Technical detail

Under the hood.

Vendor-neutral Python and configuration, Azure first, with tests included from the start.

Metric files
YAML definitions with owner, logic, allowed dimensions, and tests
SQL compiler
Simple, ratio, and derived metrics in SQLite and ANSI dialects
Test runner
Runs tests against the warehouse, including reconciliation
Certification
Records who approved which version of each definition
BI exports
MetricFlow YAML for the dbt Semantic Layer and DAX measures for Power BI
Metric catalog
A readable list of certified metrics for business users
Proof in the package

Worked example: an order warehouse and a general ledger.

Gross sales, refunds, net sales, and order counts are defined once and tested against the ledger.

What the tests show
  • Gross sales, refunds, and order counts pass and are certified
  • Net sales for August is 1.85% below the ledger
  • The cause: a manual journal not yet reversed
Result

Net sales stays uncertified until someone explains the gap. The number does not reach a board pack until it can be defended.

Where it fits

Platforms, related accelerators, and limits.

Works with

  • Snowflake, Databricks SQL, PostgreSQL, and DuckDB through ANSI SQL
  • dbt Semantic Layer through the MetricFlow export
  • Power BI through DAX measures

Pairs with

  • The Data Readiness Assessment surfaces definitions that need agreement
  • Runs on the Data Platform Foundation gold layer
  • Uses golden records from the Master Data Starter

Assumptions and limits

  • The compiler handles single-table models; joins across models use the dbt export
  • Small ANSI syntax differences are checked on your warehouse
  • Distinct counts are not additive, and tests account for that
Ask Datagist AI

Have a question about the Metrics Layer Starter?

Get an answer from our pages in seconds, with links to the sources.

Take the overview with you.

Share the overview with your team, or tell us the decision you want to improve and we will tell you whether it fits.