A dashboard decides how a number is shown. A data mart decides what the number means. Treating them as one layer is how one metric ends up with three values in the same meeting.

Three people bring "active customers" to the same meeting and get three numbers. One dashboard counts customers who placed an order in the last 30 days. Another counts customers with an open account. A third counts anyone who logged in. Each chart is correct for its own query. Nobody is wrong, and the meeting is still wasted.
This is what happens when a dashboard is asked to do two jobs: decide what a number means and decide how to show it. Those jobs belong to different layers. A data mart is where the meaning gets fixed. A dashboard is where it gets presented.
The Kimball Group's description of a data warehouse front room separates the two clearly. The presentation area holds data that is "dimensionally-structured, organized by business process", kept at the most detailed level, with summaries added for performance. BI applications sit on top: ad hoc queries, standardised reports, dashboards and scorecards [1].
| Question | Modelling layer (data mart) | Presentation layer (dashboard) |
|---|---|---|
| What does one row represent? | Decided here, once | Inherited |
| What does "revenue" include? | Decided here, once | Inherited |
| Which tables join, and how? | Decided here | Should not be decided here |
| Who is the audience? | Not relevant | Decided here |
| Which filters, periods and thresholds? | Supports them | Decided here |
| Which chart type and layout? | Not relevant | Decided here |
| Who changes it, and how often? | Data team, through review | Report owners, freely |
The last row is the practical test. Dashboards should be cheap to change. Definitions should be expensive to change, because every number that uses them moves. When the definition lives inside a chart's SQL, changing the chart risks changing the definition, and copying the chart copies the definition with whatever drift it has accumulated.
Dimensional modelling gives the modelling layer a method. The Kimball Group sets out four steps: select the business process, declare the grain, identify the dimensions, identify the facts [2]. The order matters. "The grain must be declared before choosing dimensions or facts" [3].
Here is the method applied to an illustrative example: a distributor that wants to report on sales.
dim_date
|
dim_customer -- fact_order_line -- dim_product
|
dim_region
fact_order_line grain: one row per order line
facts: quantity, gross_amount_inr, discount_inr, net_amount_inr
This is a star schema, which Kimball describes as fact tables linked to dimension tables through primary and foreign keys [6]. In PostgreSQL it is ordinary tables or views. Nothing about it requires a dedicated warehouse product.
Kimball classifies facts by how they can be summed. Additive facts can be summed across every dimension. Semi-additive facts, such as account balances, can be summed across some dimensions but not time. Non-additive facts, such as ratios, cannot be summed at all, and the advice is to store the additive parts and compute the ratio at the end [7].
Dashboards break this rule easily. Suppose a mart stores a discount percentage per region per month, and a dashboard shows the yearly figure by averaging the monthly rows. The arithmetic below is illustrative and runs on PostgreSQL.
-- Illustrative data: two months for one region
CREATE TEMP TABLE region_month (
month date,
gross_inr numeric,
discount_inr numeric
);
INSERT INTO region_month VALUES
(DATE '2026-01-01', 100000, 5000), -- 5% discount
(DATE '2026-02-01', 10000, 2000); -- 20% discount
-- Wrong: average of ratios
SELECT round(avg(discount_inr / gross_inr) * 100, 2) AS avg_of_ratios_pct
FROM region_month; -- 12.50
-- Right: ratio of sums
SELECT round(sum(discount_inr) / sum(gross_inr) * 100, 2) AS ratio_of_sums_pct
FROM region_month; -- 6.36
The two answers differ by almost a factor of two, and the averaged one overweights the small month. If the mart stores gross_inr and discount_inr and publishes the percentage only as a defined calculation, every dashboard that uses it gets 6.36. If the mart stores only the percentage, every dashboard author has to know not to average it, and some will not.
The same reasoning applies to distinct counts. "Customers who ordered" in January plus "customers who ordered" in February is not "customers who ordered" in the two months together, because some customers ordered in both. A mart can make this hard to get wrong by keeping the order-line grain available, so the distinct count is always recomputed at the level the dashboard asks for.
One mart is useful. Several marts become far more useful when they share dimensions. Kimball calls dimensions conformed when attributes in separate dimension tables have the same column names and domain contents, and describes this as "the essence of integration" because it lets results from different fact tables line up on the same rows [8].
The planning tool is the bus matrix: business processes as rows, dimensions as columns, with a mark wherever a process uses a dimension. The matrix shows which dimensions must be conformed and suggests building one row at a time [9]. For the distributor:
| Business process | Date | Customer | Product | Region | Warehouse | Carrier |
|---|---|---|---|---|---|---|
| Orders | X | X | X | X | ||
| Shipments | X | X | X | X | X | X |
| Invoices | X | X | X | X | ||
| Returns | X | X | X | X | X |
Reading down the Customer column tells you that all four processes must use the same customer dimension, with the same keys and the same attribute values. If they do, a dashboard can show orders, shipments and returns per customer segment side by side, and the segments will mean the same thing in each column. If the shipments team built its own customer table with its own segment names, that comparison is unreliable no matter how good the dashboard looks.
Not every chart needs a modelling layer behind it. A one-off exploration over a single clean table does not. The signals below are design judgements for when it starts to pay.
| Signal | Why it points to a mart |
|---|---|
| The same metric appears on more than one dashboard | One definition, many consumers; drift starts at the second copy |
| A chart's SQL joins several operational tables | The join logic is a definition and should be reviewed once |
| The metric is a ratio, a distinct count or a balance | Additivity rules need to be built in, not remembered |
| The source is the live transactional database | Analytical queries compete with the application for resources |
| People ask "how was this calculated?" | The answer should be one place, not one per chart |
| A conversational or AI tool will query the data | Clear grain and named facts reduce wrong answers (see below) |
The last signal is newer. When a language model writes SQL, a mart with one fact table at a declared grain and a column called net_amount_inr leaves far less room for error than a set of operational tables where revenue has to be reconstructed. That argument is developed in From PostgreSQL to conversational analytics.
A mart is a logical layer. In PostgreSQL there are three common physical forms, and the choice is mostly about freshness against cost.
| Form | Freshness | Query cost | Notes |
|---|---|---|---|
| View | Always current | Recomputed on every query | Simplest; fine while the underlying queries are fast |
| Materialized view | As of last refresh | Read like a table | Needs a refresh schedule |
| Table loaded by a pipeline | As of last load | Read like a table | Most control: history, slowly changing attributes, tests |
PostgreSQL's documentation states the materialized view trade-off directly: access is often much faster than querying the underlying tables, but the data is not always current [10]. REFRESH MATERIALIZED VIEW replaces the contents completely. Without CONCURRENTLY, a refresh that affects many rows tends to finish faster but can block connections reading the view. CONCURRENTLY does not lock out readers, but it needs a view that is already populated and at least one unique index that uses only column names, with no expression and no WHERE clause [11].
CREATE MATERIALIZED VIEW reporting.sales_region_month AS
SELECT date_trunc('month', d.calendar_date)::date AS month,
r.region_name,
sum(f.gross_amount_inr) AS gross_inr,
sum(f.discount_inr) AS discount_inr,
sum(f.net_amount_inr) AS net_inr
FROM reporting.fact_order_line f
JOIN reporting.dim_date d ON d.date_key = f.date_key
JOIN reporting.dim_region r ON r.region_key = f.region_key
GROUP BY 1, 2;
CREATE UNIQUE INDEX ON reporting.sales_region_month (month, region_name);
REFRESH MATERIALIZED VIEW CONCURRENTLY reporting.sales_region_month;
One operational detail is worth knowing if you harden the database. This example was run on PostgreSQL 16.15 in a scratch database where TEMPORARY had been revoked from PUBLIC. The concurrent refresh, run as the view's owner, failed with "permission denied to create temporary tables". A plain refresh by the same role succeeded, and the concurrent refresh succeeded once the role was granted TEMPORARY on the database or the default grant to PUBLIC was restored. The REFRESH MATERIALIZED VIEW reference page does not mention this, so treat it as observed behaviour and check it on your own version. From PostgreSQL 17, the right to refresh can also be granted to a role that is not the owner, through the MAINTAIN privilege [11][13].
This is an aggregate in Kimball's sense: a numeric rollup of atomic data built for speed [12]. Note that it stores the additive parts and leaves the discount percentage to be computed from sums. The atomic fact_order_line stays available for questions the aggregate cannot answer.
With the meaning settled in the mart, a dashboard can concentrate on the decisions that belong to it: who it is for, which few numbers they need first, which filters make sense, which thresholds should draw the eye, and how often it is looked at. It can be rebuilt freely without anyone worrying that the redesign changed what revenue means.
That separation is also how DataMantri, Daivota's analytics product, is organised. Analysts shape data into reusable SQL data marts, and a dashboard can be generated from a written brief with every chart backed by a real query. More detail is on the DataMantri product page. For teams designing the reporting platform underneath, the same layering question comes up in enterprise infrastructure and architecture work: where the modelling layer runs, how it is refreshed, and who reviews changes to it.
Prepared with AI-assisted research and drafting.