Skip to the page

Data engineering in the AI era · beginner · About 10 minutes

The revenue dashboard that is 17% too high

April revenue on the sales dashboard is 17.2% above finance's figure, and the board meeting is at 14:00. Find the cause in the query, not in the warehouse.

You are the analyst who owns the sales dashboard.

What happened

The sales dashboard shows April revenue of $1.84 million. Finance's month-end figure is $1.57 million. Both are built from the same closed deals, and finance's number is the one that goes to the board.

The head of sales has asked for an explanation and a corrected number before 14:00. An AI assistant wrote the dashboard query in March, and it looked right when it was reviewed.

The incident is made up. How things work in it is real, with sources at the end.

The evidence

Everything you need is here. Read it before you decide.

01Dashboard against finance, April(Table)
DashboardFinanceDifference
Revenue$1.84M$1.57M+17.2%
Customers with a closed deal418418same
Last data load06:10 today06:05 todayboth fresh
02The dashboard query(Code)
select
  date_trunc('month', d.close_date) as month,
  s.region,
  sum(d.amount) as revenue
from closed_deals d
join account_segments s
  on d.account_id = s.account_id
where d.close_date >= '2026-04-01'
  and d.close_date <  '2026-05-01'
group by 1, 2;
03What each table holds(Note)

closed_deals has 1 row per deal. account_segments has 1 row per segment an account has ever been in, with valid_from and valid_to dates, so an account that moved from Mid-market to Enterprise has 2 rows.

04A few deals traced through the join(Table)
DealAccountAmountSegment rows for the accountCounted on the dashboard
D-1042ACME-18$42,0002$84,000
D-1091NOVA-07$31,5003$94,500
D-1144TRIAD-22$18,7502$37,500
D-1150KITE-03$9,2001$9,200

Your decisions

Decision 1 of 3

  1. Decision 1

    Why is the dashboard higher than finance?