Dashboards nobody trusts: fix the pipeline, not the chart
Three people bring three numbers for the same metric and nobody is wrong. The disagreement is a pipeline property, and it is fixed with an idempotent load, lineage columns and a reconciliation job that can page someone.
Every company that has run analytics for more than a year has a version of this meeting. Three people bring three numbers for the same metric. The dashboard says 1,204. The analyst's SQL says 1,180. Finance says 934, because finance has always said 934. Nobody is lying, nobody is incompetent, and there is no incident ticket, because nothing is technically broken. The chart is rendering exactly what it was given.
That meeting is the most expensive recurring event in most data teams, and it is almost never diagnosed correctly. The instinct is to fix the presentation layer: a "last updated" badge, an annotated tile, a definitions page. All of it is theatre. A label saying as of 18 hours ago does not tell you whether the number is right, and a definitions wiki enforces nothing. The disagreement is a pipeline property and has to be fixed there, in order, because each step makes the next one possible.
Three numbers, one metric, no bug report
One metric becomes three in almost always one of six ways.
The extract is stale. The BI tool pulls a nightly snapshot; the warehouse has moved since. An 18-hour lag on a metric people watch at 10am is not a freshness problem, it is a correctness problem from the reader's point of view.
The load is not idempotent. The 02:00 job retried after a timeout at 02:07. Rows from the first partial attempt were never rolled back, so the day is double-counted. The number is 12% high and looks plausible.
The definition drifted. Two queries join the same fact table but one filters status <> 'cancelled' and the other filters status = 'complete'. Those are different metrics wearing the same name, and the difference is invisible in the tile.
The grain is wrong. Someone aggregated to order level and someone else to order-line level, then both summed a freight column.
Time zones. A UTC day boundary against an India-only business produces a permanent, unexplainable 2.5% variance at the edges of every period.
The manual override. Finance adjusted a number in a spreadsheet in March because the system was wrong then. It is still adjusted, because nobody remembers why.
Five of the six are pipeline bugs; the sixth is governance. None are chart bugs. So stop negotiating over the tile and find out which of the six you have. Put the three numbers into one query, side by side, by day. The day they diverge is the day the pipeline broke, and the shape of the delta classifies it: a step change means definition drift, an odd-day spike means duplicate load, a widening wedge means late-arriving data or a stale extract.
Fix one: make every load idempotent
Idempotency is the cheapest fix on the list and removes the largest single source of ghost numbers. The rule: running the same load twice produces the same table, byte for byte, without operator intervention.
The naive pattern — TRUNCATE then INSERT — looks idempotent and is not. Readers see an empty table during the load, and a failure halfway leaves a 40%-loaded table that looks complete downstream.
The pattern that holds up is stage, keyed upsert, then swap:
BEGIN;
-- 1. Stage the batch; nothing reaches readers yet.
CREATE TEMP TABLE stg_orders (LIKE fact_orders INCLUDING DEFAULTS) ON COMMIT DROP;
COPY stg_orders FROM STDIN WITH (FORMAT csv, HEADER true);
-- 2. A natural key makes a re-run overwrite, never append.
UPDATE stg_orders s
SET row_hash = md5(s.order_id || s.tenant_id || s.qty || s.amount_inr || s.status)
FROM fact_orders f
WHERE f.tenant_id = s.tenant_id AND f.order_id = s.order_id;
INSERT INTO fact_orders (tenant_id, order_id, qty, amount_inr, status, row_hash, _loaded_at, _batch_id)
SELECT tenant_id, order_id, qty, amount_inr, status, row_hash, now(), current_setting('app.batch_id')
FROM stg_orders
ON CONFLICT (tenant_id, order_id)
DO UPDATE SET qty = EXCLUDED.qty,
amount_inr = EXCLUDED.amount_inr,
status = EXCLUDED.status,
row_hash = EXCLUDED.row_hash,
_loaded_at = EXCLUDED._loaded_at,
_batch_id = EXCLUDED._batch_id
WHERE fact_orders.row_hash IS DISTINCT FROM EXCLUDED.row_hash;
COMMIT;
Two details matter more than the SQL. _batch_id on every row means that when someone asks why last night's number moved, you count rows per batch and see whether a batch landed twice. And the WHERE row_hash IS DISTINCT FROM clause makes a no-op re-run insert zero rows and update zero rows, so reprocessing stays cheap. On a 4M-row daily fact table, a full reprocess went from eleven minutes to under two, mostly because the planner stopped rewriting untouched rows.
If your pipeline is dbt-shaped: incremental materialisation with an explicit unique_key and merge strategy, never the default append.
Fix two: lineage belongs in the row, not in a wiki
Every organisation claims to have lineage. What they usually have is a diagram someone drew three quarters ago next to a tool nobody opens.
The version that resolves disputes is degraded and cheap: carry source identity through the transformations. Minimum viable lineage is four columns on every derived table — _source_system, _source_extract_at, _batch_id, _loaded_at. No catalog, no graph database, no vendor.
With those columns you can answer the only three questions people ask. Where did this row come from? Group by _batch_id. Which extract produced this total? Same query. Did the fix land? Compare max _loaded_at to the scheduler's run time. The layer that computes a number should carry the evidence of what it was computed from, not defer that question to a separate system that can silently disagree with it — the same failure shape as filters applied after the search instead of during it, covered in our piece on pgvector post-filter recall.
Fix three: a reconciliation job that can page someone
The reconciliation job is the only artifact here that makes a pipeline trustworthy, because it is the only thing that fails loudly. Everything above makes errors less likely. This makes them visible.
Write it as a query that returns a gap when the world is wrong, wrap it in a check that exits non-zero, and route it to the same alerting channel as your uptime checks. No dashboard tile, no weekly PDF.
CHECKS = {
# name: (sql, tolerance, severity)
"orders_daily_vs_warehouse": ("""
WITH a AS (SELECT sum(amount_inr) v FROM fact_orders
WHERE order_date = current_date - 1),
b AS (SELECT sum(amount_inr) v FROM raw.stripe_charges
WHERE charge_date = current_date - 1 AND status = 'succeeded')
SELECT round(abs(coalesce(a.v,0) - coalesce(b.v,0)), 2) AS gap FROM a, b
""", 0.005, "page"),
"duplicate_batches": ("""
SELECT count(*) AS gap FROM (
SELECT _batch_id FROM fact_orders GROUP BY _batch_id, order_id
HAVING count(*) > 1) d
""", 0, "page"),
"metric_definition_parity": ("""
SELECT abs(
(SELECT count(*) FROM fact_orders
WHERE order_date = current_date - 1 AND status <> 'cancelled')
- (SELECT count(*) FROM bi.daily_orders_snapshot
WHERE order_date = current_date - 1)
) AS gap
""", 0, "warn"),
}
for name, (sql, tol, severity) in CHECKS.items():
gap = fetch_scalar(sql) or 0
if gap > tol:
alert(severity, f"{name}: gap={gap} tol={tol}", runbook=name)
Three checks carry most of the value: source-to-warehouse totals, duplicate batches, and parity between the warehouse and what BI serves. The last one is what catches the stale extract, because it compares what the business reads against what the pipeline believes.
Tolerance is a design decision, not a formality. Zero where zero is achievable — duplicates, counts, parity. A 0.5% tolerance silently permits a 0.5% bug forever.
Failure modes that survive all three fixes
These fixes remove the boring 80% of disagreements. Three things still get through.
Late-arriving data. Refunds land three days after the order. A pipeline that only reprocesses yesterday never fixes the day the refund belongs to. The fix is a bounded lookback — reprocess the last seven to fourteen days every run — which only works if the load is idempotent. That is why fix one comes first.
Backfills that change history. Any backfill is a silent metric revision unless announced. Tag it with its own _batch_id and post the revision where people consume the number.
Schema drift upstream. A source adds a status value, and your status <> 'cancelled' filter quietly starts counting test rows. Assert on the accepted enum set per run and fail when a new value appears.
Every one of these is a change-detection problem, not a compute problem. Which is the useful reframing: your dashboards are not wrong, they are unmonitored.
What to instrument, and what to delete
Trust comes from a few observable properties: how fresh the extract is against its SLA, whether each run's row counts fall inside an expected band, whether reconciliation gaps are zero, and whether any batch landed twice. Four numbers, one boring page. A pipeline that needs a human to interpret its health page needs a human to interpret its numbers too.
The deletion half matters as much. Every tile without a named owner, a stated grain and a definition living beside the SQL is a future argument. If you cannot say which table, which filter and which time zone produced a number, you do not have a metric — you have a decoration people will stop believing, and then they go back to the spreadsheet.
Ship the definition with the metric, the lineage with the row, and the reconciliation job with the pipeline. The chart is the least interesting part of the system, and it will keep telling the truth about whatever you feed it.
None of this needs a new platform: four columns, one upsert, and a cron job that can fail. It is the same conclusion we keep reaching in architecture reviews — boring systems that fail loudly beat clever ones that degrade quietly. A data pipeline is just the part of the system where nobody notices the difference until a board meeting.