Forum Discussion

ronaldt5's avatar
ronaldt5
Frequent Visitor
4 years ago
Solved

Cumulative total Year on Year

Please help! I would like a measure that gets me the cumulative total year on year.

 

Thank you

  • Hi, ronaldt5 ;

    Base on my understand , you could create a measure .

    Measure = 
    CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),[name]=MAX('Table'[name])&&[Date]<=MAX('Table'[Date])))

    Or 

    percent% = 
    var _result=
    DIVIDE(SUM('Table'[value]),
    CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),[name]=MAX('Table'[name])&& YEAR([Date])=YEAR(MAX('Table'[Date]))-1)))-1
    return IF(_result<>-1,_result)

    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.

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ronaldt5 Maybe:

    Measure =
      VAR __Year = MAX('Table'[Year])
      VAR __Today = TODAY()
      VAR __Date = DATE(__Year,MONTH(__Today),DAY(__Today))
      VAR __Table = FILTER(ALLSELECTED('Table'),[Date]<=__Date)
    RETURN
      SUMX(__Table,[Value])
  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, ronaldt5 ;

    Base on my understand , you could create a measure .

    Measure = 
    CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),[name]=MAX('Table'[name])&&[Date]<=MAX('Table'[Date])))

    Or 

    percent% = 
    var _result=
    DIVIDE(SUM('Table'[value]),
    CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),[name]=MAX('Table'[name])&& YEAR([Date])=YEAR(MAX('Table'[Date]))-1)))-1
    return IF(_result<>-1,_result)

    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.