Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Aggregation for Same Period Last Year-

Hi Everyone,   I have an aggregate measure accumulating the sales as the months go on called "Actual TRG AGG"     I've highlighted above the portion relating to the Aggregating eleme...
  • amitchandak's avatar
    4 years ago

    Anonymous , In the that max filter for cumulative you should use date table

     

    filter(allselected('Date'),'Date'[date] <=max('Date'[date])

     

     

    and for one year use the same calculation with

    var _max = max('Date'[date])

    var _date = date(year(_max), month(_max), day(_max) )

    return

    calculate([Actual TRG], filter(allselected('Date'),'Date'[date] <=_date ) , <Rest of the calc> )