Every DAX beginner hits the same confusion: should this be a calculated column or a measure? They look similar but behave completely differently. Understanding the distinction — and defaulting to measures — is the turning point in learning DAX.
Two ways to calculate
Both are written in DAX, but a column is computed once per row, at refresh and stored, while a measure is computed on the fly for whatever the report is currently showing.
Calculated columns
A calculated column adds a new column to a table, evaluated for each row using row context (it can see the other columns in its row). It's stored in the model, using memory:
-- New column in the Sales table:Line Total = Sales[Quantity] * Sales[Price]-- Good for: a value you want to slice/filter BY, or use in a relationship.
Measures
A measure is a calculation performed at query time over the currently-filtered data — it uses filter context (Chapter 9), not row context. It stores nothing and recomputes as the user slices:
Total Sales = SUM(Sales[Line Total])Avg Order = AVERAGE(Sales[Line Total])-- The SAME measure returns the total for whatever is on screen —-- per month, per region, grand total — no extra formulas needed.
Which to use
| Use a… | When you need to… |
|---|---|
| Measure | Aggregate (sum, avg, %, ratio) — the vast majority |
| Measure | Have the value respond to slicers/filters |
| Calculated column | Slice/group/filter BY the value |
| Calculated column | Use the value in a relationship or a slicer |
Practice
Add a Line Total calculated column (quantity × price) — a per-row value. Then write a Total Sales measure that sums it, and drop the measure into a table by month and by region to see it recompute. Note why a "% of total" must be a measure.
Key takeaways
- 01Calculated columns compute per row at refresh (row context) and are stored — use to slice/group BY.
- 02Measures compute on the fly over the filtered data (filter context) and store nothing — use to aggregate.
- 03The same measure returns the right number for every level (month, region, total).
- 04Default to measures; over-using calculated columns bloats the model and gives filter-blind results.
- 05Ask: filter BY it → column; aggregate it / respond to slicers → measure.
