Metrics
While measures are simple aggregations on a single model, metrics encode complex business calculations that might:
Span multiple models
Include complex business rules
Combine multiple measures
Apply specific filters by default
If measures are single building blocks, measures are a combination of them.
Additionally, metrics can specify more parameters like default filters (like exclude_deleted) and allowed dimensions (e.g. customer_segment, region, order_date), allowing the agent to reliably answer questions like “How does our average revenue per customer compare between regions over time?”. This prevents nonsensical breakdowns (like trying to show "revenue per customer" grouped by individual product SKU).
Examples
Simple column relations:
SUM(assigned_quotes) / SUM(total_quotes) * 100→ quote_acceptance_rateAggregations:
SUM(revenue) / COUNT(DISTINCT customer)→ average_revenue_per_customerComplex metrics: retention_rate →
COUNT(CASE WHEN last_order_date >= CURRENT_DATE - INTERVAL '90 days' THEN 1 END) / COUNT(*) * 100Cross-model:
SUM(orders.amount) / COUNT(DISTINCT customers.customer_id)→ revenue_per_customer
Last updated
Was this helpful?