Grain
The grain is a table's level of detail, what exactly one row stands for: one order, or one campaign on one day.
You cannot line up two tables at different grains row by row. For return on ad spend (ROAS), spend sits at one campaign on one day and orders at one order, so add each up by channel and date first and line up only the totals.
In a data model the grain is set and tested. An AI agent on raw tables guesses it from table and column names, and one wrong join returns a wrong number with no error.
Example
As of October 22, 2026, Shopify documents one event per row in its sales data, so one order can produce several rows when refunds or adjustments follow. An agent that counts those rows counts a refund as another order. In Google's Looker example, joining orders to their order lines makes the sum of order totals 223.44 instead of the correct 124.84, because each order's total repeats once per line.