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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
brs09j
Helper II
Helper II

Column = SUM ( Order[Price] ) has row context with a calc column but still grabs total sum

I watched Marco's video but still don't get this.

 

I tried switching this to a SUMX and still got the same result.

 

I thought the row context was being established by the calculaed column and aggregator? What am I missing here.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

When you are calculating a single row, the context is that single row.  Thus if you do a "SUM" on a column of the current table, you will only be summing up 1 rows worth of values.

 

Instead you might want to use a calculate statement and provide a filter context.  For example, this would give you a sum total of all of the prices where each row has the same location value.  (I have no idea why you would do that, but i hope it illustrates the point).

 

Column = 
VAR LocationValue = [Location]
RETURN
CALCULATE(
	SUM ( Order[Price] ),
	ALL ( Order ),
	Order[Location] = LocationValue
)

View solution in original post

1 REPLY 1
Anonymous
Not applicable

When you are calculating a single row, the context is that single row.  Thus if you do a "SUM" on a column of the current table, you will only be summing up 1 rows worth of values.

 

Instead you might want to use a calculate statement and provide a filter context.  For example, this would give you a sum total of all of the prices where each row has the same location value.  (I have no idea why you would do that, but i hope it illustrates the point).

 

Column = 
VAR LocationValue = [Location]
RETURN
CALCULATE(
	SUM ( Order[Price] ),
	ALL ( Order ),
	Order[Location] = LocationValue
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors