Forum Discussion
Most recent MAX value
- 3 years ago
hi MASF
Now i see, try to write a measure like this:
LastestPeak = VAR _table = FILTER( TableName, VAR _val = [val] VAR _date = [date] VAR _valpre = MINX( FILTER( TableName, _date -1 = [date] ), [val] ) RETURN IF(_val>_valpre, TRUE, FALSE) ) VAR _datemax = MAXX(_table, TableName[date]) RETURN MAXX( FILTER( _table, TableName[date]=_datemax ), TableName[val] )
Hi Dima
Thanks for your reply.
I am looking to know, in the entire dataset, what is the latest max value. Not the max value in the dateset. Without date filters.
In the data I provided:
1. the latest date is the 2022-10-11, and it's value is 113.
2. The previous day 2022-10-10 the value is the same.
3. On the previous 2022-10-09 the value is higher 115
4. On the previous day, 2022-10-08 the value decreases, it's 110, thus I don't want to look any furthe back, I want the value of 115.
Hope it clarifies 🙂
Miguel
- MASF3 years agoFrequent Visitor
Yes. Looking at the most recent date, and then going backwords, return the first max (or, as soon as the value decreases (for the previous day), stop looking back and return the previous value).