Power BI

Measure vs. Calculated Column

Also called: Calculated column, Measure, Calculated measure

In Power BI, a calculated column is worked out once per row at refresh and stored in the table; a measure is worked out when a visual needs it, for whatever filters that visual applies.

Left, a calculated column Margin = Sales[Amount] - Sales[Cost] gives one stored value per row: order A 100 - 50 = 50, order B 400 - 320 = 80, order C 500 - 450 = 50. Right, a measure Margin % = DIVIDE(SUM(Sales[Margin]), SUM(Sales[Amount])) is computed when a visual asks: 180 ÷ 1,000 = 18%.

How they differ

Both are written in DAX, and both show up in the field list, but they’re calculated at different times.

A calculated column is calculated once for every row when the semantic model refreshes, and the results are stored like any other column. In the example, Margin = Sales[Amount] - Sales[Cost] gives 50 for order A (100 − 50), 80 for order B (400 − 320) and 50 for order C (500 − 450).

A measure isn’t stored. It’s calculated each time a visual needs it, for the filters that visual applies. Margin % = DIVIDE ( SUM ( Sales[Margin] ), SUM ( Sales[Amount] ) ) gives 180 ÷ 1,000 = 18% for all three orders, and a different answer for each row of a region matrix.

Calculated columnMeasure
CalculatedAt refresh, per rowAt query time, per visual cell
StoredYes, adds to model sizeNo
Reacts to slicersNo, the value is fixed per rowYes
Use on slicers, rows, axesYesNo
Good forCategories, bands, flags, keysTotals, ratios, comparisons

The averaging trap

Margin % as a calculated column gives 50% for order A, 20% for order B and 10% for order C, and averaging those rows gives 26.7%, which is wrong. Margin % as a measure divides total margin by total amount, 180 ÷ 1,000 = 18%, which is right

The most common mistake is putting a ratio in a calculated column. Order A’s margin is 50%, B’s is 20% and C’s is 10%. A visual that averages that column shows (50% + 20% + 10%) ÷ 3 = 26.7%, as if the $100 order counted as much as the $500 one.

The real margin is total margin divided by total amount: 180 ÷ 1,000 = 18%. Only a measure gets that right at every level, because it sums first and divides second, in each cell’s filter context.

A quick rule

  • Will you slice, group or filter by it? Calculated column. Examples: “Order size band”, “Is weekend”, “Region group”.
  • Will you add it up, compare it or divide it? Measure. Examples: Revenue, Margin %, YoY %, Running total.
  • Can it be done before the model? Then consider doing it in Power Query or the source database instead, which keeps the model simpler.

Best practices

  • Measures by default. Reach for a calculated column only when you need a row-level value to slice by.
  • Never store a ratio in a column you’ll aggregate. Store the parts and divide in a measure.
  • Watch the fact table. Calculated columns on millions of rows cost memory and refresh time.
  • Name them so the difference shows. Some teams prefix columns or keep all measures in one measures table.

Mocking up measures and columns

A mockup shows which fields are filters (columns) and which are numbers (measures) before anyone writes DAX: slicers and row headings are columns, KPI cards and values are measures. See why to mock up Power BI reports before you build.

See it in a real layout

These free Mockko templates use it. Open one and edit it in your browser.

Related terms

Common questions

When should I use a calculated column instead of a measure?
Use a calculated column when you need a value per row that you'll slice, group or filter by, such as a price band or a customer segment. Use a measure for anything you aggregate or compare, such as totals, ratios and year-over-year change.
Do calculated columns slow down Power BI?
They make the model bigger, because the value is stored for every row and takes memory, and they add time to each refresh. A few are fine. Many on a large fact table add up.
Can I use a measure in a slicer?
Not directly. Slicers, rows and axes need column values. If you need to filter by a calculated result, such as customers above a spend threshold, create a calculated column or a table that groups the values.

Mock it up before you build it

Lay out your Power BI or Tableau dashboard in Mockko, get sign-off, then build. Free to start.

Try Mockko free