The short answer
Grain is the answer to: "What does 1 row represent?"
Examples:
- 1 row per order
- 1 row per order line
- 1 row per customer per day
- 1 row per page view event
If the grain is unclear, joins and aggregates silently double-count.
fct_orders grain: 1 row per order
join to order_items (1 row per line) without care
-> revenue duplicated across linesHow to protect grain
- Document it in the model description
- Enforce uniqueness tests on the grain key
- Aggregate to the needed grain before joining facts
Interview tip: Start modeling answers with grain. Interviewers notice that habit.