Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lastnn30
Post Patron
Post Patron

measure vs column

Hi, I created measure and then a column but to my surprise they are the same when I created reports. They both sliced per item. So I do not see any difference except the Total. Why is that?

Thank you very much.

 

revenue-measure = SUM(Sheet1[price])*SUM((Sheet1[quantity]))

revenue-Col = Sheet1[price]*Sheet1[quantity]

 

SNAG-0569.jpgSNAG-0568.jpgSNAG-0567.jpg

 

1 ACCEPTED SOLUTION
ribisht17
Super User
Super User

This is expected, there is nothing to aggregate when you are at the lowest granularity (or say row-level )

hence, sheet(price)=sum(sheet(price))   -----

 

As mentioned by @bcharger 1000 is nothing but (10+20+30+40) * (1+2+3+4)=100*10=1000 because the measure will aggregate since it has got a chance to summarise for the 4 rows while for row-level it will sum up the values you see at the rows

 

See it this way, 

----EXPLANATION OF THE DIFF IN THE TOTAL PART -------

 

TOTAL (SUM(PRICE) * SUM(QUANTITY))  ------ 

 

>>> SUM(PRICE)Let me first aggregate for the 4 rows 

>>>SUM(QUANTITY)  Let me first aggregate for the 4 rows

>>> Now do the multiplication 

>>> Now TOTAL of the same

 

While in the former case

its PRICE * QUANTITY (No Sum) hence you get the individual rows multiplication

At the end you do the TOTAL

That set

 

Regards,

Ritesh

 

Regards,

Ritesh

 

 

View solution in original post

4 REPLIES 4
ribisht17
Super User
Super User

Please mark the relevant answer as correct and help the community as well

 

Ritesh

v-rongtiep-msft
Community Support
Community Support

Hi @lastnn30 ,

This brings us to the difference between measure and column. 

Even if they look similar, there is a big difference between calculated columns and measures. The value of a calculated column is computed during data refresh and uses the current row as a context; it does not depend on user interaction in the report. A measure operates on aggregations of data defined by the current context, which depends on the filter applied in the report – such as slicer, rows, and columns selection in a pivot table, or axes and filters applied to a chart.

At this point, you might be wondering when to use calculated columns over measures. Sometimes either is an option, but in most situations your computation needs determine your choice.

You have to define a calculated column whenever you want to do the following:

  • Place the calculated results in a slicer, or see results in rows or columns in a pivot table (as opposed to the values area), or in the axes of a chart, or use the result as a filter condition in a DAX query.
  • Define an expression that is strictly bound to the current row. For example, Price * Quantity cannot work on an average or on a sum of the two columns.
  • Categorize text or numbers. For example, a range of values for a measure, a range of ages of customers, such as 0–18, 18–25, and so on.

However, you must define a measure whenever you want to display resulting calculation values that reflect user selections and see them in the values area of a pivot table, or in the plot area of a chart – for example:

  • When you calculate profit percentage on a certain selection of data.
  • When you calculate ratios of a product compared to all products but keeping the filter both by year and region.

Here is a simple sample, please refer to it to see if it helps you.

What is the difference between Power BI calculated columns and measures? 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

ribisht17
Super User
Super User

This is expected, there is nothing to aggregate when you are at the lowest granularity (or say row-level )

hence, sheet(price)=sum(sheet(price))   -----

 

As mentioned by @bcharger 1000 is nothing but (10+20+30+40) * (1+2+3+4)=100*10=1000 because the measure will aggregate since it has got a chance to summarise for the 4 rows while for row-level it will sum up the values you see at the rows

 

See it this way, 

----EXPLANATION OF THE DIFF IN THE TOTAL PART -------

 

TOTAL (SUM(PRICE) * SUM(QUANTITY))  ------ 

 

>>> SUM(PRICE)Let me first aggregate for the 4 rows 

>>>SUM(QUANTITY)  Let me first aggregate for the 4 rows

>>> Now do the multiplication 

>>> Now TOTAL of the same

 

While in the former case

its PRICE * QUANTITY (No Sum) hence you get the individual rows multiplication

At the end you do the TOTAL

That set

 

Regards,

Ritesh

 

Regards,

Ritesh

 

 

bchager6
Super User
Super User

I believe; The measure is summing the price column (100) and summing the quantity column (10) then multiplying them to arrive at 1,000. The calculated column is looking at each row but not the aggregate.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.