Forum Discussion
MASF
3 years agoFrequent Visitor
Most recent MAX value
Hello Anybody knows how to create a DAX measure to get the LATEST (most recent) MAX value? For example, in the set of dates bellow, the most recent max value is 115 and it happened on the 2022-1...
- 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] )
MASF
3 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).