Metrics and dimensions
Metrics and dimensions
A metric is a defined numeric result, such as total revenue or number of orders. A dimension describes how records can be grouped or filtered, such as region, product or date. The same metric can be calculated for different selections without changing its definition.
Example: compare regions
Using the five-line fixture, region is the grouping field and revenue is the metric. North: L01, L02, L04 = $104. South: L03, L05 = $96. Selecting South excludes the North lines, so the selected revenue is $96; the original source is unchanged.
Example: product categories
The product lookup maps P01 to Stationery, P02 to Home and P03 to Travel. Grouping the same line revenue by category yields $60, $90 and $50 respectively. These three category values add to $200. The product table supplies the descriptive grouping; the sales table supplies the transaction amounts.
Common mistake: adding identifiers
ProductKey identifies a product, and OrderID identifies an order. Their labels are not measurements. Counting order lines is different from counting distinct orders: this fixture has five lines but four orders. Choose the aggregation that answers the actual question.
Practice
Name a metric and dimension for a question about the number of items sold by region. Compute the North and South quantities, and check their sum against all rows.
Further official reading
These links provide supporting context; the local fixture and its expected results remain unchanged.