Transaction fact table
A fact table with one row for each individual business event, such as a payment, an order line, or a click, recorded at the moment it happens. A row exists only if the event took place.
Also: transactional fact table · transaction grain fact table · atomic fact table
On this page · 7 sections
- Category
- Data modeling
- Also known as
- transactional fact table, transaction grain fact table, atomic fact table
- Goes deeper in
- Data Modeling
A transaction fact table records events one at a time. Each row is a single measurement at a point in time: this customer paid this amount by this method on this day. The grain, meaning what one row represents, is the event itself. It is the most detailed of the three fact table types Ralph Kimball defines, alongside the periodic snapshot and the accumulating snapshot.
Because the rows are atomic, they can be grouped by any dimension attached to the event, and no question about the event is ruled out in advance. Each row carries a foreign key for every dimension, numeric facts that are true at that grain, and sometimes an exact timestamp or a degenerate dimension such as the order number.
The table is as dense or as sparse as the business. A day with no payments has no rows, and nothing in the table says the day existed. In the plain case rows are inserted and not revisited. A later change in the business, such as a refund, is recorded as an event of its own.
select
d.calendar_date,
count(f.payment_id) as payments,
coalesce(sum(f.amount), 0) as amount
from dim_dates d
left join fct_payments f on f.date_key = d.date_key
where d.calendar_date between '2026-03-01' and '2026-03-04'
group by d.calendar_date
order by d.calendar_dateIt is the table to build first. Snapshots and aggregates can be derived from transaction rows, and the reverse is not possible: a monthly total cannot be split back into the payments that made it.
Its sparseness shapes queries. Reports that must show zero for a quiet day, or a customer with no orders, have to start from the dimension and left join to the facts, because the fact table has nothing to return for events that did not happen.
- Storing facts that are not true at the transaction grain, such as an order-level shipping charge repeated on every line row, where it will be summed several times.
- Expecting the table to answer state questions directly. The balance on the 15th requires adding up every transaction before that date; a periodic snapshot answers it with one row.
- Aggregating before loading to save space, which discards the detail that makes this type worth having.
- What is the grain of a transaction fact table?
- One row per event, at the lowest level the source records: one row per payment, per order line, per page view. State the grain in a sentence before choosing columns, and check that every measure on the row is true at that level. A measure that belongs to the whole order does not belong on an order-line row.
- What is the difference between a transaction fact table and a periodic snapshot?
- A transaction fact table has a row for each event and no row when nothing happens. A periodic snapshot has a row for every entity in every period, whether or not anything happened, and its measures summarize the period or record a level at its end. Transactions answer what happened; snapshots answer what the state was.
- Can rows in a transaction fact table be updated?
- They are normally inserted once and left alone, which is what makes the table simple to load incrementally. Changes in the business are recorded as further events: a refund row, a cancellation row, an adjustment row. Updating in place is for fixing load errors. If rows need regular updates as a process advances, an accumulating snapshot is the better fit.
