building-dbt-semantic-layer

Create and modify dbt Semantic Layer components using MetricFlow.

653|60|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer-dbt-labs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: building-dbt-semantic-layer
Source: https://github.com/dbt-labs/dbt-agent-skills/tree/main/skills/building-dbt-semantic-layer
Command: npx skills add https://github.com/dbt-labs/dbt-agent-skills --skill building-dbt-semantic-layer-dbt-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The skill provides a guided, repeatable approach to building and updating the dbt Semantic Layer components—semantic models, entities, dimensions, and metrics—using MetricFlow to ensure consistent definitions across projects.

Core Features & Use Cases

  • Enable and configure semantic models by adding the semantic_model block to model YAML.
  • Define primary and foreign entities, time-based dimensions, and business metrics within YAML.
  • Design derived, cross-model, and time-based metrics and validate configurations with dbt parse and MetricFlow tooling.

Quick Start

Define the semantic_model, entities, dimensions, and metrics in your model YAML as shown, then run the appropriate validation commands to verify correctness.

Frequently Asked Questions about building-dbt-semantic-layer

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

FAQPage Schema
How do I create a semantic model in dbt using MetricFlow?▼

To create a dbt semantic model, add a semantic_model block to your model YAML and define entities, dimensions, and metrics using MetricFlow syntax. This establishes consistent metric definitions across your dbt project.

How do I define primary keys and entities in dbt semantic layer YAML?▼

Define entities within the semantic_model block in your YAML file, specifying primary keys to establish unique identifiers. You can also configure foreign entities to enable cross-model joins for complex metric calculations.

What types of metrics can I build with MetricFlow in dbt?▼

MetricFlow supports building simple, derived, cumulative, and cross-model metrics within the dbt semantic layer. You configure these metrics directly in YAML to ensure consistent analytical definitions.

How do I validate semantic layer YAML configurations in dbt?▼

Validate your dbt semantic layer YAML by running dbt parse and utilizing MetricFlow tooling. These validation steps check that your semantic models, entities, dimensions, and metrics are configured correctly.

Can I configure time-based dimensions with granularity in dbt semantic models?▼

Yes, you can configure time-based dimensions within the semantic_model block, setting specific granularity levels. Setting up time spines allows accurate time-based aggregations for cumulative metrics.