Skip to main content

Dimensions vs Measures

Editorial

Introduction

Before we start exploring data, there is one fundamental concept you must understand: the difference between dimensions and measures. This distinction is at the heart of every data analysis, every dashboard, and every report you will ever build.

Getting this concept right makes everything else in analytics easier to understand.

What Are Dimensions?

Dimensions are the descriptive, categorical columns in your data. They tell you the who, what, where, and when of your business events.

Dimensions are used to:

  • Group data into categories
  • Filter data to specific subsets
  • Slice metrics from different angles

Examples from Our Database

TableColumnDimension Values
dim_customerscountryGermany, France, Australia, ...
dim_customersgenderMale, Female, n/a
dim_customersmarital_statusSingle, Married
dim_productscategoryBikes, Components, Accessories, Clothing
dim_productssubcategoryMountain Bikes, Road Bikes, Helmets, ...
dim_productsproduct_nameMountain-100 Black- 42, AWC Logo Cap, ...

Key Characteristics of Dimensions

  • They are usually text (strings) or dates
  • You cannot meaningfully sum or average them
  • You use them in GROUP BY, WHERE, and ORDER BY clauses
  • They answer qualitative questions: "Which country?" "What product?"

What Are Measures?

Measures are the numerical, quantitative values in your data. They tell you how much, how many, or how often something happened.

Measures are used to:

  • Aggregate data (sum, count, average)
  • Calculate KPIs and business metrics
  • Compare performance across groups

Examples from Our Database

TableColumnWhat It Measures
fact_salessales_amountRevenue from a sale
fact_salesquantityNumber of items sold
fact_salespriceUnit selling price
dim_productscostProduct cost

Key Characteristics of Measures

  • They are usually numbers (integers, decimals)
  • You can meaningfully sum, average, count, and compare them
  • You use them with aggregate functions: SUM(), AVG(), COUNT(), MIN(), MAX()
  • They answer quantitative questions: "How much revenue?" "How many orders?"

Dimensions vs Measures: Side by Side

Here is a clear comparison:

AspectDimensionsMeasures
TypeCategorical (text, dates)Numerical
PurposeDescribe and categorizeQuantify and calculate
SQL UsageGROUP BY, WHERE, ORDER BYSUM(), AVG(), COUNT()
QuestionWho? What? Where? When?How much? How many?
ExamplesCountry, Category, GenderSales, Quantity, Price
Can you sum it?No (summing country names is meaningless)Yes (summing sales gives total revenue)
Dimensions vs measures: dimensions create the groups; measures are added up inside them. Dimensions answer who, what, where and when — country (where), gender and marital_status (who), category and product_name (what), order_date (when); they go in GROUP BY and WHERE, and you cannot sum them. Measures answer how much and how many — sales_amount (revenue), quantity (items sold), price (unit price), cost (product cost); they go in SUM, AVG and COUNT, and you can sum them. How they work together, the lesson's query: SELECT c.country, SUM(f.sales_amount) AS total_sales FROM gold.fact_sales f LEFT JOIN gold.dim_customers c ON c.customer_key = f.customer_key GROUP BY c.country ORDER BY total_sales DESC — c.country is the dimension that groups, sales_amount the measure that is summed. The result, total sales by country: United States 9,162,327; Australia 9,060,172; United Kingdom 3,391,376; Germany 2,894,066; France 2,643,751; Canada 1,977,738; n/a 226,820.

How They Work Together

The real power comes from combining dimensions and measures. Dimensions are the lens through which you view measures.

For example:

-- Total sales (measure) broken down by country (dimension)
SELECT
    c.country,              -- dimension: groups the data
    SUM(f.sales_amount) AS total_sales  -- measure: aggregated value
FROM gold.fact_sales f
LEFT JOIN gold.dim_customers c
    ON c.customer_key = f.customer_key
GROUP BY c.country
ORDER BY total_sales DESC;

In this query:

  • country is the dimension — it groups rows into categories
  • sales_amount is the measure — it gets summed within each group

You can swap the dimension to see the same measure from a different angle:

-- Same measure (total sales), different dimension (product category)
SELECT
    p.category,              -- different dimension
    SUM(f.sales_amount) AS total_sales  -- same measure
FROM gold.fact_sales f
LEFT JOIN gold.dim_products p
    ON p.product_key = f.product_key
GROUP BY p.category
ORDER BY total_sales DESC;

Same measure, different dimension, completely different insight. This is the core pattern of data analytics:

Measure + Dimension = Insight

Edge Cases: When It Is Not Clear

Some columns can act as both depending on context:

  • Dates are technically dimensions (they categorize events by time), but they can also be used to calculate measures (e.g., DATEDIFF() produces a number)
  • Price is a measure, but if you use it to create price ranges (e.g., "under 100","100", "100-$500"), those ranges become dimensions
  • Order number is a dimension (it identifies an order), but COUNT(DISTINCT order_number) turns it into a count of orders — a new measure derived from a dimension

The rule of thumb: if you are grouping by it, it is acting as a dimension. If you are aggregating it, it is acting as a measure.

Summary

Understanding dimensions vs measures is the foundation of data analytics:

  • Dimensions = descriptive, categorical columns used for grouping and filtering
  • Measures = numerical columns used for aggregation and calculation
  • Together = dimensions slice measures to produce insights

As we move through the EDA project, every query you write will combine dimensions and measures. Keep this distinction in mind — it will make every analysis clearer.