What is the difference between calculated column and measure in Power BI

In this Power BI Tutorial, we will discuss what are calculated columns in Power BI? What are measures in Power BI and what is the difference between the calculated column and measure in Power BI?

Before understanding the difference between a measure and a calculated column, let us understand first what is calculated columns and what are measures in Power BI?

Calculated Column in Power BI

We can create a new column to a table in the data model in the Power BI desktop. We can create a column by defining a DAX expression which will evaluate row by row in the entire table.

To create a column in the Power BI desktop, click on New column like below:

difference between calculated column and measure in Power BI

Then you can write a DAX expressions like below:

Total Cost = Sales[Price]*Sales[Quantity]
difference between calculated column and measure power bi

The above DAX expression will calculate values by multiple the two columns Price and Quantity column from the Sales table.

You can see the output like below:

power bi difference between measure and calculated column

If you will add the data in a Table visualization, the Power BI visualization will like below:

dax difference between measure and calculated column

In the calculated column, the calculation is done row by row in the rable.

Another thing, we need to remember that, calculated column stores values in memory like other columns.

The calculation is done when refreshing the report in Power BI desktop.

Measure in Power BI

Now we will see what are measures in Power BI.

Measures are used to calculate aggregates like SUM, SUMX, average, calculate, etc. Measures are calculated at the time of query and they are not stored in the database.

Measures are not stored in the memory, so these are faster. Click on New measure like below:

dax difference between measure and calculated column

Write the formula like below:

Total Revenue = SUM(Sales[Total Cost])
difference between calculated column and measure in power bi

If you will add a Card visualization in Power BI, you can see the Power BI measure value like below:

What is the difference between calculated column and measure in Power BI

If you need to operate on aggregate values instead of on a row-by-row basis, you must create measures.

When to use Calculated Column and when to use Measure?

Here the question comes as to when to use the calculated column and when to use measures in Power BI?

This depends on the requirement.

If you want to calculate row by row, then create a calculated column in Power BI.

If there is a requirement for aggregation or if you need filter criteria for the report, then you can create a measure in the Power BI.

You may like following Power BI tutorials:

This Power Bi tutorial we learned:

  • What is a calculated column in Power BI?
  • What are measures in Power BI?
  • Difference between a calculated column and measure Power BI
  • When to use Calculated Column and when to use Measure?
>