Sub topic 1
What a Measure Is and How It Differs from a Calculated Column
Prerequisites
Assume you know the Power BI Desktop Report view, the Fields pane, and basic tables, columns, and rows. You also need a loaded table such as Sales, with a numeric SalesAmount column.
Measures and Calculated Columns
A measure is a DAX formula that calculates a result when a visual needs it. Power BI evaluates the formula using the current filter context, which is the set of filters from slicers, visual fields, page filters, and report filters.
A calculated column is a value calculated separately for every row when the model refreshes. It becomes stored data in the table.
| Feature | Measure | Calculated column |
|---|---|---|
| Calculated when | A visual queries it | The model refreshes |
| Result | Usually one result for the current context | One value per row |
| Best for | Totals, counts, ratios | Row-level categories or values |
Use a measure for “total sales in the current selection.” Use a calculated column for “profit for each order line.”
Creating Your First Measure
- In the Fields pane, right-click the
Salestable. - Select New measure.
- Enter this formula in the formula bar:
Total Sales = SUM(Sales[SalesAmount])- Press Enter.
- Add
Total Salesto a Card visual.
The name before = identifies the measure. SUM adds the visible values in Sales[SalesAmount]. Use clear names and format monetary measures as currency from the Measure tools ribbon.
How Filters Change a Measure's Result
Place Total Sales in a table with Product[Category]. Power BI evaluates the same measure once for each category. Each row applies that category as a filter, so the result changes.
A slicer for Sales[Year] works the same way. Selecting 2025 changes the filter context, and Total Sales returns only sales visible under that selection. The formula does not change.
A common error is expecting a measure to preserve one fixed total. If you need a fixed value, you must deliberately remove filters with other DAX functions. For ordinary reporting, context-sensitive behavior is the main reason to use measures.
Exercise
Should “SalesAmount minus CostAmount for each row” usually be a measure or a calculated column?
Show answer
Use a calculated column when you need a stored row-level result. Use a measure when you need an aggregated result that responds to filters.