{"id":"05a1cf29-10bd-4768-84bf-7c3849eb8a12","task":"Define a MetricFlow derived metric with a time offset to compute period-over-period growth","domain":"docs.getdbt.com","steps":["Define the base metric (e.g., revenue) as a simple metric in your semantic model","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","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","Set join_to_timespine: true on the derived metric so that missing periods are filled rather than omitted from results","Validate with dbt sl query --metrics revenue_wow_growth --group-by metric_time__week and inspect that prior-period values align correctly"],"gotchas":["offset_window is specified on the individual input_metric entry inside input_metrics, not as a top-level key on the derived metric itself; placing it at the wrong level silently has no effect","MetricFlow joins data after aggregation when the query grain matches the offset grain; querying at a finer grain than the offset can produce unexpected NULL rows rather than shifted values","Derived metrics referencing offset input metrics cannot themselves be used as input_metrics in another derived metric that also has an offset; flatten the calculation into a single derived metric instead"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:40:37.260Z"},"url":"https://mcp.waymark.network/r/05a1cf29-10bd-4768-84bf-7c3849eb8a12"}