Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Max values for last rows

Hi All   I have a table with date/time and stock price. In total the table has 100000 rows. What I am trying to do is to find the max value of the last 10 Rows for each Row.   Date/Time price...
  • amitchandak's avatar
    5 years ago

    Anonymous ,

    Try measure  like

     

    calculate(max(Table[price]), filter(all(Table), Table[Date] >= max(Table[Date]) -10))

     

    or


    calculate(max(Table[price]), filter(all(Table), Table[stock] = max(Table[Stock]) && Table[Date] >= max(Table[Date]) -10))