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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ajmonster
Helper II
Helper II

Sum values by line excluding past entries for same ID

Hello

 

I need help running calculations on a live survey feed.

 

I have a table that will continuously add records to itself. I need to sum values but I can't sum in previous records for the same ID. For example, suppose I have the following table:

NameCompletedValue
Jon2/26/20182
Jacob2/25/20183
Jon2/24/20181
Jill2/26/20185
Jim2/26/20184
Jacob2/23/20184

 

For sums, I only want to sum the values for each name given the latest date for that name. The sum I want returned is:

Jon = 2
Jacob = 3
Jill = 5

Jim = 4

Total = 14

Average = 3.5 

 

Thanks,

ajmonster

 

PS Bonus points if you can somehow create a table comprised of the unique Names and have their records update when the master query has a more recent record.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@ajmonster

 

The Bonus points :

 

Go to Modeling- New Table

 

Table =
SUMMARIZECOLUMNS (
    Table1[Name];
    "Lastrecord"; MAX ( Table1[Completed] );
    "Value"; CALCULATE (
        SUM ( Table1[Value] );
        FILTER ( Table1; Table1[Completed] = MAX ( Table1[Completed] ) )
    )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

4 REPLIES 4
Vvelarde
Community Champion
Community Champion

@ajmonster

 

The Bonus points :

 

Go to Modeling- New Table

 

Table =
SUMMARIZECOLUMNS (
    Table1[Name];
    "Lastrecord"; MAX ( Table1[Completed] );
    "Value"; CALCULATE (
        SUM ( Table1[Value] );
        FILTER ( Table1; Table1[Completed] = MAX ( Table1[Completed] ) )
    )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

@Vvelarde

 

Is there a way to merge all the columns from Table1 (in my exact case, I have 40 columns) into this created Table?

@ajmonster

 

Hi, i'm not sure that can be possible without reference all the columns that you want to summarize.

 

 




Lima - Peru

@Vvelarde This is it. Thank you.

 

Would I be able to use SELECTEDVALUE ( Table1[Value] ) instead of SUM( Table1 [Value] ) to select the field Value in the case that there are two records under the same [Name] and same [Completed] date?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.