What a reporting layer is
The reporting layer is the set of tables, views or metric definitions that every report reads from. It sits after the warehouse models that clean and join source data, and before the dashboards, spreadsheets and exports people look at. Its job is to make sure a metric with one name has one definition.
It can be as simple as a handful of marts with documented columns, or as formal as a semantic layer that defines measures and dimensions in code and generates the SQL. For a small team the form matters less than the rule: business logic is defined once, below the BI tool, and reports only filter, group and display.
Decide where each kind of logic lives
Most metric drift happens because the same rule is written in several places. Assign each kind of logic to one layer and stick to it.
- Warehouse models: cleaning, deduplication, joins, the grain of each table, and the business rules that decide which records count, such as excluding test and cancelled orders.
- Reporting layer: the metric definitions themselves, the formula, the unit and how the metric may be aggregated, plus the dimensions it may be sliced by.
- BI tool: filters, date ranges, groupings and presentation. A calculated field that redefines a metric in a single dashboard is a second definition waiting to disagree with the first.
- Spreadsheets and exports: read from the reporting layer, never recalculated from raw data.
Define each metric once, in writing, before coding it
A metric definition answers the questions that cause disagreements later: who owns it, what it counts, what it excludes, at what grain it is calculated, in which time zone, and whether it can be summed across days or customers. Write those answers down and have the owner approve them before the SQL is written.
Ratios and distinct counts need special care. A conversion rate or average order value must be calculated from summed numerators and denominators at the reporting grain, not by averaging daily rates. Monthly unique customers cannot be summed from daily unique customers. Record which aggregations are valid as part of the definition.
Choose the form: marts or a semantic layer
Reporting marts are tables with metrics pre-calculated at a fixed grain, for example one row per day per channel. They are easy to understand and work with any BI tool, but every new grain or breakdown needs another table, and ratios must be recalculated correctly at each level.
A semantic layer defines measures and dimensions once, and generates the query for whatever grouping a report asks for. It removes duplicate marts and handles ratios consistently, at the cost of another tool to learn and integrate. Start with marts; move to a semantic layer when the number of marts serving the same metric becomes the maintenance problem.
Keep reports from drifting apart
Add tests on the reporting layer, not only on the models below it: keys unique at the stated grain, totals that reconcile with the fact table they came from, and no unexpected gaps in dates. When a definition changes, treat it like an API change: name the consumers, compare old and new figures for a past period, and announce the switch.
Review the reporting layer on a schedule. Metrics nobody has used for a quarter, and dashboards defining their own versions of governed metrics, are the first things to retire or fix.