What is Fact Table?

A fact table stores the measurable events of a business, one row per event, such as a sale, a click or a shipment.

Fact Table explained

Facts contain numbers you add up or average (amount, quantity, duration) plus keys pointing to the dimension tables that describe each event.

The most important decision is the grain: what exactly one row represents. If the grain is one row per order line, summing amount is correct; if it is mixed, totals are wrong.

Example

A fact_orders table with one row per order line holds order_id, product_id, customer_id, date, quantity and line_amount.

Frequently asked questions

What is Fact Table?
A fact table stores the measurable events of a business, one row per event, such as a sale, a click or a shipment.
Can you give an example of Fact Table?
A fact_orders table with one row per order line holds order_id, product_id, customer_id, date, quantity and line_amount.