Metric Definition Template (KPI)
One metric or KPI: business question, plain definition, formula, grain, SQL sketch, filters, targets, caveats
Anleitung: Use when a metric is reported to more than one team or used as a KPI. Write the plain-language definition before the formula and list every filter. The main pitfall is exclusions hidden in dashboards, which makes numbers disagree.
Vorschau
Metric Definition: [Metric name]
Definition of one business metric or KPI, written so that anyone who computes it gets the same number: the question it answers, the plain definition, the formula, grain and dimensions, source tables with a SQL sketch, filters, freshness, targets, caveats and change history. Replace every
[bracketed]value and every item marked Example. Worked examples use a 30-day customer retention rate.
| Field | Value |
|---|---|
| Metric ID | [MET-RET-030] |
| Metric name | [30-day customer retention rate] |
| Short name / code | [retention_30d] |
| Version | [1.1] |
| Status | [Proposed / Certified / Deprecated] |
| Metric owner | [@metric-owner], [team] |
| Technical owner | [@analytics-engineer] |
| Type | [KPI / Health metric / Guardrail / Diagnostic] |
| Unit | [Percent] |
| Desired direction | [Higher is better] |
| Certified in | [Semantic layer or BI tool name and object] |
| Last updated | YYYY-MM-DD |
1. Business question
[Example: "Are new customers finding enough value to come back within a month of their first purchase? Used by the growth team to judge onboarding changes and by leadership in the monthly business review."]
| Audience | Decision informed |
|---|---|
| Example: Growth team | Keep or roll back onboarding experiments |
| Example: Leadership | Allocation between acquisition and retention spending |
| [Audience] | [Decision] |
2. Definition in plain words
[Example: "Of all customers who made their first purchase in a given week, the share who made at least one more purchase within 30 days after that first purchase."]
3. Formula
For a cohort of customers whose first purchase falls in week , and the time of customer 's first purchase:
| Symbol | Meaning |
|---|---|
| Customers with first valid purchase in ISO week (UTC) | |
| Timestamp of the first valid purchase of customer | |
| Valid purchase | Order with status not cancelled, see section 6 |
Worked example: in week 2026-W14, 4 820 customers made a first valid purchase, and 1 470 of them bought again within 30 days, so
Validation: [Example: "The certified implementation reproduces this value for cohorts 2026-W10 to 2026-W14 within 0.1 points of an independent notebook calculation by a second analyst; evidence in ticket ANL-482."]
Edge cases: [Example: "A cohort is reported only after 30 full days have passed for its last member. If the value is null, not zero."]
4. Grain and dimensions
| Item | Value |
|---|---|
| Grain | Example: Weekly first-purchase cohort |
| Allowed dimensions | Example: Acquisition channel, country, first-order product category, platform |
| Not allowed | Example: Customer age: not reliably collected; small cohorts reveal individuals |
| Aggregation across dimensions | Example: Recompute from customer level; never average percentages |
| Minimum cohort size for display | Example: 100 customers |
5. Source tables and SQL sketch
| Table | Role | Contract |
|---|---|---|
analytics.fct_orders | Purchases | dc-fct-orders-001 |
core.customers | Customer attributes, test-account flag | dc-customers-003 |
| [Table] | [Role] | [Contract] |
-- Sketch: 30-day retention by weekly first-purchase cohort (UTC)
WITH valid_orders AS (
SELECT o.customer_id, o.order_ts
FROM analytics.fct_orders AS o
JOIN core.customers AS c ON c.customer_id = o.customer_id
WHERE o.status <> 'cancelled'
AND c.is_test_account = FALSE
AND c.is_employee = FALSE
),
first_purchase AS (
SELECT customer_id, MIN(order_ts) AS first_ts
FROM valid_orders
GROUP BY customer_id
),
cohort AS (
SELECT customer_id, first_ts, DATE_TRUNC('week', first_ts) AS cohort_week
FROM first_purchase
WHERE first_ts < CURRENT_TIMESTAMP - INTERVAL '30 days'
),
returned AS (
SELECT DISTINCT k.customer_id
FROM cohort AS k
JOIN valid_orders AS v
ON v.customer_id = k.customer_id
AND v.order_ts > k.first_ts
AND v.order_ts <= k.first_ts + INTERVAL '30 days'
)
SELECT
k.cohort_week,
COUNT(*) AS cohort_size,
COUNT(r.customer_id) AS retained,
100.0 * COUNT(r.customer_id) / COUNT(*) AS retention_30d_pct
FROM cohort AS k
LEFT JOIN returned AS r ON r.customer_id = k.customer_id
GROUP BY k.cohort_week
HAVING COUNT(*) >= 100
ORDER BY k.cohort_week;
Note: the cohort filter above excludes customers with fewer than 30 days of history; the published metric additionally drops whole cohort weeks until all members are complete (section 3).
6. Filters and exclusions
| ID | Exclusion | Reason |
|---|---|---|
| EX-01 | Example: Cancelled orders | Not a completed purchase |
| EX-02 | Example: Test and employee accounts | Not real customers |
| EX-03 | Example: Orders fully refunded within 24 hours | Treated as cancelled by finance policy |
| EX-04 | Example: B2B accounts | Different buying cycle; tracked by MET-RET-B2B |
| [EX-nn] | [Exclusion] | [Reason] |
7. Freshness and availability
| Item | Value |
|---|---|
| Refresh | Example: Daily by 07:00 UTC |
| Latency to final | Example: A cohort week is final 37 days after the week starts |
| Upstream dependency | Example: fct_orders pipeline DPS-ORDERS-001 |
| Restatement policy | Example: Final values change only with a definition version change, announced in section 11 |
8. Targets and thresholds
| Item | Value | Set by | Valid until |
|---|---|---|---|
| Target | Example: at least 32% by Q4 | [@leadership] | YYYY-MM-DD |
| Healthy range | Example: 28% to 36% | [@metric-owner] | Ongoing |
| Alert | Example: Weekly value more than 3 points below 8-week median | [@analytics] | Ongoing |
| Benchmark | Example: 29.5% average in the previous year | Historical data | n/a |
9. Known caveats
- [Example: Customers who check out as guests get a new
customer_ideach time, so retention is understated by an estimated 2 to 3 points.] - [Example: Cohorts in late November include holiday shoppers who return less often; compare year over year, not week over week.]
- [Example: Before YYYY-MM-DD, app orders were missing for two days; affected cohorts are flagged.]
10. Related metrics
| Metric | Relationship |
|---|---|
| Example: MET-RET-090 90-day retention | Longer-horizon version |
| Example: MET-ACQ-001 New customers | Denominator size; mix shifts can move retention |
| Example: MET-REV-020 Revenue per retained customer | Value of retention |
| [Metric ID] | [Relationship] |
11. Change log
| Version | Date | Author | Change | History restated |
|---|---|---|---|---|
| 1.0 | YYYY-MM-DD | [@name] | Example: First certified definition | n/a |
| 1.1 | YYYY-MM-DD | [@name] | Example: Added EX-03 (refunds within 24 h) after finance review | Yes, from YYYY-MM-DD |
| [x.y] | YYYY-MM-DD | [@name] | [Change] | [Yes / No] |
Standard and licence note
Based on common industry practice for metric and KPI definitions in analytics and semantic layers. Original text written for this collection. Template licence: MIT.
Ähnliche Vorlagen
AI Agent Specification Template
Specify a tool-using AI agent: autonomy level, tools and permissions, guardrails, security, trajectory evals, cost
KI & DatenAI Feature PRD Template
PRD for an AI-powered feature: why AI, failure and uncertainty UX, metrics, eval thresholds, cost per request, rollout
KI & DatenAI Post-Market Monitoring Plan Template (EU AI Act Article 72)
Post-market monitoring plan for a high-risk AI system: data collection, thresholds, reviews, Article 73 incident reporting