Replacing numeric calculated columns with measures
Calculated columns and measures are different in the way they are stored and calculated within Power BI. When calculated columns are added to a data model, the values are calculated and stored for every row. This means that if there are 1,000 rows in a table and you add a calculated column for Margin
(using a formula taking sales minus production costs), then for each row of the table, the data model would store a value for Margin
. This data would be stored and updated whenever the model was refreshed so there are storage and performance implications when using many calculated columns.
Measures are not stored but instead calculated when used on the fly. Instead of creating a calculated column for Margin
, you could instead create a measure that performs the same calculation, but the value would not be stored in the data model but instead be computed when the measure is used in a report visual.
For Power BI to use a measure to...