Forum Discussion

sonm10's avatar
sonm10
Icon for Helper I rankHelper I
6 years ago
Solved

Previous value with group/category

Hello all,   I have values for 3 items against date. I want to calculate the rate of change of the value for the item.The dates are not necessarily consecutives and each item may not have the same ...
  • Greg_Deckler's avatar
    Greg_Deckler
    6 years ago

    sonm10 - Sorry, I messed that up. 

     

    Column =
    VAR __Current = [Value]
    VAR __PreviousDate = MAXX(FILTER('Test','Test'[Date] < EARLIER('Test'[Date]) && [Group] = EARLIER([Group])),[Date])
    VAR __Previous = MAXX(FILTER('Test','Test'[Date] = __PreviousDate && [Group] = EARLIER([Group])),[Value])
    RETURN
    __Current - __Previous