Define a MetricFlow derived metric with a time offset to compute period-over-period growth

domain: docs.getdbt.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define the base metric (e.g., revenue) as a simple metric in your semantic model
  2. Create a second derived metric entry with type: derived, an expr referencing the base metric, and add an input_metrics block listing the base metric with an offset_window value such as 1 month or 7 days
  3. Add a third derived metric that subtracts the offset metric from the current-period metric using expr to produce the absolute change, or divides them to produce a growth rate
  4. Set join_to_timespine: true on the derived metric so that missing periods are filled rather than omitted from results
  5. Validate with dbt sl query --metrics revenue_wow_growth --group-by metric_time__week and inspect that prior-period values align correctly

Known gotchas

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans