Stocks vs. Flows: Why You Can’t Sum Balances Across Time
A practical time map for data engineers: why balances differ from activity, how profit carries into equity, and what that means for facts, snapshots and aggregation.
A company has $100 in cash on Monday morning. It collects $60 and pays $40 during the day. At the end of Monday, it has $120.
Now imagine a dashboard that adds Monday’s $120 balance to Tuesday’s $130 balance and calls the result “cash this week.” The arithmetic works. The meaning has disappeared.
This is the part of accounting I want more data engineers to study: every number carries a relationship with time. Some numbers describe what exists at a boundary. Others describe what happened between two boundaries. A database can store both in the same numeric type and happily let us combine them incorrectly.
For a data engineer, this distinction determines fact-table grain and aggregation rules. It also gives us a completeness test: can we explain how the opening position became the closing position?
A stock sits at a boundary; a flow spans an interval
A balance sheet describes financial position as of a particular point. An income statement reports performance over a period. A cash-flow statement reports cash movements over a period. The SEC’s guide to financial statements makes those distinctions accessible without requiring a bookkeeping course.
For our cash example:
Opening cash + cash received − cash paid = closing cash
$100 + $60 − $40 = $120
The balances are stocks. The receipts and payments are flows. A flow here is an amount accumulated over an interval; a rate such as dollars per second is another quantity again.

Write the interval as [t₀, t₁): include events at the start and exclude those at the end. Opening state is before events at t₀; closing state includes events strictly before t₁. Adjacent windows then meet without double-counting. Name the timezone too.
There is a real accounting-technology connection here. XBRL, used for digital business reporting, distinguishes instant facts from duration facts. Its date conventions explain why a December 31 closing balance can be represented at the midnight boundary entering January 1. The IFRS taxonomy marks revenue and cash flows as duration facts and end-of-period cash as an instant fact.
What survives the year-end boundary?
Suppose our fictional company earns $30 of profit during a year. That $30 measures the year’s performance. Next year’s income statement starts measuring a new interval.
The assets, liabilities and equity continue into that next interval. In a conventional closing process, the period’s income and expense account balances are closed, and the profit or loss ultimately feeds retained earnings. Implementation can use closing entries or reporting mechanisms.
A simplified retained-earnings rollforward is:
Opening retained earnings + profit − dividends ± direct adjustments = closing retained earnings
That equation needs its labels. Profit is not the entire change in equity. Owner contributions and other equity movements belong in their appropriate components. Foreign-currency translation and other comprehensive income can affect equity without passing through the period’s net profit. And profit is not the change in cash: a credit sale can affect profit before the customer pays. FASB’s conceptual framework describes why accrual performance and cash receipts or payments can occur in different periods.
The performance window starts again; cash, inventory, obligations and equity carry forward.
Choose the question, then choose the fact grain
Kimball’s description of fact tables identifies three familiar grains. Each gives us a different way to retain evidence about time.
Transaction facts: what happened?
A payment fact might contain one row per payment, with an event identifier, customer, amount and effective timestamp. Sum the appropriate payment rows over Monday and you obtain Monday’s receipts.
The grain must say whether a row represents an authorized payment, a settled payment or a reversal. Those events have different meanings even when they share a payment identifier. Replaying them twice without deduplication can turn a valid event stream into an invalid balance.
Periodic snapshots: what was the position?
A daily customer-receivable snapshot can store one row per customer at each day-end. It makes “how much was outstanding last Friday?” inexpensive to answer.
A periodic snapshot may also contain that day’s sales or collections. Its row is defined by a reporting period, but its individual measures still have different semantics. “Closing receivable” is a position; “collections during the day” is activity. Putting them in the same row does not give them the same aggregation rules.
Accumulating snapshots: where has the process reached?
An order pipeline might use one row per order, updated as the order is placed, shipped and delivered. The row accumulates milestone dates and durations. It is convenient for answering “which orders are still waiting to ship?”
A single current row will not, by itself, preserve every earlier version of that pipeline. Kimball’s time-stamped accumulating-snapshot design discusses preserving state-change events and historical snapshots for those additional questions.

Addition needs permission from the measure
Receipts for disjoint days can be added into a weekly receipt total, assuming a consistent currency, scope and treatment of corrections. Daily closing cash balances cannot be added into weekly cash.
This is the idea behind semi-additive facts. Kimball Group uses balances as a common example: they can often be aggregated across appropriate dimensions, but not across time.
Even “across customers” needs care. The populations must not overlap, units must be compatible, and consolidation may require eliminating internal balances. An average balance requires a defined weighting rule. A margin percentage requires its revenue and profit components; adding percentages rarely answers the intended question.
The check I would put in every design review
Choose one balance. Name its grain, currency, scope, timezone and cutoff. Reconcile opening position plus movements to closing position. Then ask which dimensions each measure may be summed across.
Those few decisions make the difference between a table of numbers and a model whose answers retain their meaning. Put them in the metric contract before someone writes SUM(amount).
For the related choice of historical versus current classifications, see Which Version of the Past?.