A plausible number can still be wrong
A sales dashboard shows a sensible average order value for each day. Switch to a weekly view and the figure still looks reasonable. Yet it may give a misleading basis for a promotion or staffing decision if the dashboard averages those daily averages.
The first question is how the metric is recalculated when the reporting period changes. For average order value, the weekly calculation should divide eligible weekly revenue by the number of eligible weekly orders. Changing the date range must preserve that definition.
The average-of-averages trap
Consider this invented example, using four orders in the same week. On Monday, one order brings in £900. On Tuesday, three orders bring in £100 each. The daily average order values are £900 and £100.
Averaging the two daily figures gives £500. But the week contains £1,200 of revenue and four orders, so its average order value is £300. The £500 calculation gives each day equal weight, even though Tuesday has three times as many orders.
The practical rule is to aggregate the components first, then divide. For a daily summary containing revenue and eligible order count, the weekly expression is SUM(revenue) / SUM(order_count), with decimal division and an explicit zero-denominator policy. A pre-aggregated table can therefore be sufficient: keep the components rather than only the displayed average.
This rule has boundaries. Daily summaries must cover disjoint orders under the same eligibility rules, and retain the dimensions needed for later filters. Distinct customer counts need different treatment: adding daily unique-customer counts counts returning customers again. Account balances also need a defined snapshot rule rather than a sum across dates.
What dbt and MetricFlow add
The dbt Semantic Layer lets teams put shared metric definitions in their dbt project. MetricFlow generates SQL from semantic models and metric definitions; Amazon Redshift is a supported platform. For average order value, model revenue and order count as the inputs to a ratio metric and request the reporting grain at query time.
The benefit depends on adoption. A dashboard that continues calculating its own average from exported daily averages can still disagree. Identify which reports actually consume the governed metric, and check their totals as well as their individual rows.
AWS published a Redshift walkthrough on 9 November 2026 using dbt-redshift 1.9.5 and dbt-metricflow 0.11.0. Its small example illustrates day-to-week recalculation. Treat it as a version-specific demonstration, rather than a production compatibility guarantee.
The current dbt metrics documentation labels its newer specification as applying to dbt v1.12 and later. Avoid mixing that YAML with the walkthrough's older semantic-model and measure syntax. Choose a supported version combination and use its matching documentation. The hosted Semantic Layer also has account-tier and setup requirements; running an open-source MetricFlow demonstration does not establish that a particular BI integration is ready.
Choose the smallest useful change
For a few stable dashboards, first consider repairing the existing calculations and retaining revenue and order-count totals in the reporting tables. This is a proposed starting point when the available dimensions and metric ownership are already manageable.
Consider a shared query-time metric layer when teams repeatedly reproduce the same definitions across tools, or users need many combinations of dates and dimensions. It introduces modelling, integration and operational work, so evaluate it against a concrete reporting problem.
Pre-aggregation remains an option for performance, provided the retained grain and components support the questions being asked. Measure query latency and warehouse consumption on representative workloads before choosing an approach. No performance or cost improvement has been measured for this article.
Prove the definition across reporting views
Start a pilot with one disputed metric and a named business owner. Agree what counts as an order, whether revenue includes tax, delivery and refunds, which currency is used, and which timezone and week boundary apply. Record those choices alongside the definition.
Use a small fixture with uneven daily volumes, multiple stores, a cancelled order, a refund and a store with no orders. Establish expected revenue, order count and average by hand before comparing the base-order query, any summary table and the semantic metric. These are proposed acceptance tests, not completed checks.
- Change day to week and month. Reconcile numerator and denominator separately, including a partial week.
- Filter to one store or order status. Verify that both metric inputs follow the intended population; any difference should be deliberate.
- Introduce an order with multiple line items. Check order-key uniqueness and revenue totals before and after joins; an unchanged ratio can conceal duplicated inputs.
- Test empty periods and zero orders. Decide whether to display an undefined value or another explicit state, and distinguish missing data from zero activity.
- Confirm the dashboard total recomputes the ratio across the selected population instead of averaging visible row values.
Make the reporting contract reviewable
Keep the initial pilot focused: one definition, its inputs, a business owner, supported reporting dimensions and an agreed set of expected results. Expand only after the dashboard and underlying calculations reconcile. A metric layer provides a place to encode the contract; the business still has to agree what the number means.
Frequently asked questions
Why is an average of averages sometimes wrong?
It gives each group equal weight regardless of its size. For average order value across disjoint groups, divide combined eligible revenue by combined eligible order count. An unweighted average of group averages is guaranteed to agree when group sizes are equal, but should not be the general roll-up rule.
Do we need dbt Semantic Layer to fix this?
A reporting table that retains compatible revenue and order-count totals can support a correct roll-up without a new metric service. A shared semantic layer becomes worth evaluating when definitions are repeated across tools or reporting dimensions change frequently.
Does MetricFlow correct bad source data?
MetricFlow constructs queries using the declared models, metrics and entity relationships. It does not establish that the underlying order records or business definitions are correct. Validate keys, populations and source totals as part of the metric pilot.
Can we use the AWS example with current dbt YAML?
The November 2026 AWS walkthrough pins dbt-redshift 1.9.5 and dbt-metricflow 0.11.0. Current dbt documentation describes a newer metric specification for v1.12 and later. Follow documentation matching your chosen versions and validate the configuration before adopting it.



