Forum Discussion

JL011's avatar
JL011
Regular Visitor
4 years ago
Solved

Aggregating latest value only for multiple IDs

Hi folks, Been struggling with this one for a while now.  I am very close but could use a little help to finish this one up.  I am simply looking to take the last value of a duplicate ID in a time...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, JL011 ;

    You could try it.

    Total Amount1 = 
    var _maxdate = CALCULATE(MAX('Table'[ValidFromDate]),FILTER(ALL('Table'),EOMONTH([ValidFromDate],0)=EOMONTH(MAX('Table'[ValidFromDate]),0)))
    return IF(MAX('Table'[ValidFromDate])=_maxdate, CALCULATE(SUM([Probability_hst]),FILTER(ALL('Table'),[ValidFromDate]=_maxdate)))
    Max Opportunity By Last Date = 
    var _table = SUMMARIZE('Table',[ParentId], "_value", [Total Amount1])
     return SUMX( _table,  [_value])

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.