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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mrlang02
Frequent Visitor

Measure to Calculate Group Sums in PivotTable

Hi,

 

I am using my data model with both Power BI and PowerPivot, thus why I am posting here.  

 

Here is an example of my data structure.  I have the first 3 columns in my data table.  I am trying to write a measure that will allow me to generate the 4th column, which is the sum of "Value1" within each date group.  This seems like it should be simple, but everything I try returns the original "Value1" for each row instead of the group aggregate.  Thanks for your help.

 

DateObsValue 1SumDatexValue
1/1/20191200750
1/1/20192300750
1/1/20193250750
1/2/201916002000
1/2/201925002000
1/2/201939002000
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @mrlang02 

It sounds like you need a calculated column rather than a measure. Try this:

SumDatexValue =
CALCULATE ( SUM ( Table1[Value1] ), ALLEXCEPT ( Table1, Table1[Date] ) )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @mrlang02 

It sounds like you need a calculated column rather than a measure. Try this:

SumDatexValue =
CALCULATE ( SUM ( Table1[Value1] ), ALLEXCEPT ( Table1, Table1[Date] ) )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

mrlang02
Frequent Visitor

Thank you so much this works perfectly.  Appears I can use this as either a calculated column or measure and it achieves what I need.

In general, I've read that using measures whenever you can will improve calculation times, thus why I was taking that approach.  But very helpful to know I can do it either way.  

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.