Forum Discussion

zolotrip's avatar
zolotrip
Regular Visitor
4 years ago
Solved

Maximum value in dynamic date range

Hi there.   It might sound simple, but I have been looking this solution up for quite a long time, almost everywhere on the internet, unsuccesfully, so far.   I would need something "dynamic", le...
  • amitchandak's avatar
    4 years ago

    zolotrip , Please find code for new column and measure

     

    new column =
    maxx(filter(Table, Table[date] >= earlier(Table[Date]) -3 && Table[date] <= earlier(Table[date])),[Table[value])

     


    new measure =
    maxx(filter(allselected(Table), Table[date] >= max(Table[Date]) -3 && Table[date] <= max(Table[date])),[Table[value])