dbt Semantic Layer: A Practical Guide with Tags & Meta

11 minutes to read
Get free consultation

 

Business Intelligence (BI) efforts frequently stall because of inconsistent metrics defined across Power BI, Tableau, and Looker. Analytics engineers are tasked with building a single source of truth that flexibly scales and fosters trust—without the friction of debating definitions for every new dashboard. In this guide, we explain how to implement a robust, maintainable dbt semantic layer using only native dbt features: tags and meta. You will learn how to centralize metric definitions, ensure dbt metric consistency, and ease future integration with BI tools—all without needing to license a new product.

Looking for end-to-end analytics strategy inspiration? Explore how we help organizations create reliable architectures on our Data Platform Modernization project page.

The Core Problem: Why Scattered Metrics Erode Business Trust

Few things break business trust like reporting different numbers for the same data. Maybe marketing and finance can’t agree on Monthly Active Users (MAU) or revenue. The root causes:

This fragmentation results in conflicting numbers, heated debates, and delays as teams try to reconcile spreadsheets instead of delivering insights. The lack of a single, maintainable semantic layer not only creates risk but also increases compliance challenges, especially when handling PII.

From Data Chaos to a Single Source of Truth

We see these challenges in nearly every team we advise. The clear answer: centralize all metric logic in code, upstream of every BI tool. By building a dbt semantic layer as your canonical source, you guarantee

Our Foundational Framework vs. dbt’s MetricFlow

dbt Labs offers MetricFlow, their paid approach to semantic modeling. While powerful, it requires dbt Cloud and v1.6+ and may not suit all teams yet. Our framework uses only dbt Core features—tags and meta—so you can tackle inconsistency, operationalize logic, and prep for MetricFlow later. Many organizations begin here, then smoothly migrate to advanced tooling once governance and consistency are established. This bridges the gap, solving today’s problems and future-proofing your stack.

A Practical Blueprint: Using dbt Tags & Meta for Governance

Centralizing logic is only sustainable if metadata is discoverable, governable, and BI team-friendly. Here’s how to lay the groundwork for a scalable dbt semantic layer architecture using tags and meta fields.

Step 1: Use tags for Clear Categorization and Discovery

dbt tags enable flexible organization of your models, sources, and columns. You can group by business domain (like finance), criticality (such as sla_reporting), or sensitivity (like pii)—making searching, automation, and selective runs effortless.

For example:

Want more detail? See the official dbt tags documentation.

Code Example: Tagging Models by Business Domain (e.g., ‘finance’, ‘product’)

models:
  - name: customer_revenue
    tags: [finance, revenue, reporting]
  - name: feature_usage
    tags: [product, engagement]

You can now easily filter, test, or run all models tagged as finance from the dbt CLI, helping with CI/CD, incident response, or BI integration.

Step 2: Use meta to Add Rich Business and Governance Context

Tags organize, but meta adds the business meaning and compliance rules required for mature data governance. The meta key in dbt YAML supports arbitrary key-value pairs—vital for encoding ownership, PII status, SLAs, or even custom data policies.

When audit, compliance, or BI teams need answers about a field’s use, owner, or privacy status, meta documentation ensures they get one source of truth, not conflicting spreadsheets.

Check out the dbt meta documentation.

Code Example: Defining Metric Owners, PII Status, and Reporting Rules

columns:
  - name: email
    meta:
      pii: true
      owner: "david.ashirov@stellans.com"
      data_policy: "Never export outside EU"
  - name: monthly_active_users
    meta:
      metric_owner: "product_analytics@acme.com"
      reporting_frequency: "monthly"
      business_definition: "User with at least one activity in last 30 days"

With this approach, compliance and business rules are visible at a glance. Catalog tools and BI integrations can index these meta values to help end users see the meaning and owner for any metric directly inside Tableau or Power BI.

Walkthrough: Defining 'Monthly Active Users' in Your Semantic Layer

Let’s put this into practice. Here’s how to model and document the MAU metric so everyone—engineers and business users—references the same logic, tracked and owned within your dbt semantic layer.

Centralizing Business Logic in Your Core dbt Model

First, write the logic for MAU in a central dbt model. This eliminates redundant calculations in downstream BI platforms and ensures all dashboards pull consistent numbers. Version controlling the metric in dbt also helps you align changes across Power BI, Tableau, and Looker instantly—no more waiting for manual updates or fixing misaligned dashboards.

Using meta to Document the ‘MAU’ Definition for BI Users

Now, add structured meta fields for compliance, owner, and business rules. This context is invaluable when integrating with BI tools, supporting audits, or onboarding new team members.

models:
  - name: monthly_active_users
    description: "Users with at least one qualifying session in 30 days."
    tags: [engagement, product]
    meta:
      owner: "product_analytics@acme.com"
      last_modified: "2024-05-18"
      definition: "A user with any activity event in the previous 30 days. Used for executive reporting."
      approved_by: "vp_data@acme.com"
      data_governance:
        pii: false
        sla_reporting: true

With this structure, you:

Scaling Your Semantic Layer Across the Organization

As your organization or dbt project matures, scaling the semantic layer is easy when you structure tags and meta from the start.

From a Semantic Model to a Data Mesh

Strategically applying tags and meta enables a data mesh approach. Multiple teams (finance, sales, marketing) maintain domain-specific models, but adhere to centralized conventions for governance (like always tagging PII columns, assigning owners, and documenting definitions). Since dbt Core’s YAML is highly portable, you can scale this pattern across multiple dbt projects or teams. Automated documentation tools can ingest these conventions for discovery and onboarding.

How This Foundation Enhances dbt Power BI and Tableau Integration

Modern BI tools increasingly support semantic layer integration. With your logic and business context documented in dbt meta fields, catalog tools (such as dbt Docs) and some third-party integrations can synchronize metadata with Power BI or Tableau. This means analysts downstream trace numbers to their source, eliminating error-prone duplicative logic and addressing a top pain point—dbt Power BI integration. As dbt and the community continue to evolve (e.g., with v1.6+ for native MetricFlow and better BI catalog connectors), starting with robust tags and meta ensures painless transitions and upgrades later.

To learn about semantic layer best practices, see Wikipedia’s introduction.

https://stellans.io/wp-content/uploads/2025/10/pexels-vlada-karpovich-7433922-1-scaled.jpg

Best Practices for a Maintainable dbt Semantic Layer

Based on our experience building scalable semantic layers for clients, here are actionable best practices:

Applying these habits improves maintainability and compliance. It brings teams closer to operationalizing a dependable dbt semantic layer architecture.

FAQ: Building a dbt Semantic Layer

What is a semantic layer in the context of dbt?

A semantic layer in dbt is where all business metrics, logic, and governance rules are centrally defined as code, not scattered in disparate dashboards. This ensures BI tools connect directly to trusted, consistent, and auditable metrics. Learn more in Wikipedia’s semantic layer overview.

What’s the difference between this framework and using MetricFlow?

This approach leverages dbt’s native, free features (tags and meta) for immediate pain relief and flexibility. MetricFlow is an advanced, paid dbt Labs product designed to further automate metric management, centralization, and BI integrations. Most teams benefit by starting with core features for accountability and consistency, and can later upgrade to MetricFlow as their needs grow.

How do dbt tags and meta improve data governance?

Ready to Build Your Single Source of Truth?

Equipping your analytics and BI teams with a robust dbt semantic layer is the fastest way to move beyond metric debates, streamline compliance, and ensure consistent insight. By adopting tags and meta as foundational tools, you can:

Take the friction out of data-driven decision-making. Contact Stellans for a semantic layer consultation and transform your analytics stack today.

Article By:

https://stellans.io/wp-content/uploads/2024/09/DavidStellans2-1-2.png
David Ashirov

Co-founder and CTO of Stellans

Related Posts

    Get a Free Data Audit

    * You can attach up to 3 files, each up to 3MB, in doc, docx, pdf, ppt, or pptx format.