Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Return previous month value based on ID

Hi   This is driving me insane!   I have a table full of ID's with values for particular dates. I would like to create a new column which returns the previous value for each ID, but only if it is...
  • amitchandak's avatar
    amitchandak
    3 years ago

    Anonymous , My mistake , it should me maxx

     

    Previous value =

    var _min = maxx(filter(Table,[ID] = earlier([ID]) && [Date] < earlier([Date]) ),[Date])
    return
    maxx(filter(Table,[ID] = earlier([ID]) && [Date] =_min),[Current Value])