Forum Discussion
rnehrboss
4 years agoHelper II
Creating a last maximum? calculation
I'd like to create a measure that looks through last records finds the local max (100 in this example) and then uses the time and battery level from that record, along with the most recent local min ...
rnehrboss
4 years agoHelper II
Thanks Ryan!
I think you are close to the right solution. One thing I didn't include (sorry) is that I have a column with devices. So I think the "status" column is calculating based on all reported device percentages instead of grouping and calculating. Is it possible to have the "status" column calculate on groupings?
ryan_mayu
4 years agoSuper User
pls try this
status =
VAR _last = maxx(FILTER('Table','Table'[create_time]<EARLIER('Table'[create_time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])),'Table'[create_time])
var _lastvalue= maxx(FILTER('Table','Table'[create_time]=_last),'Table'[Battery])
return if(_lastvalue<'Table'[Battery],"charging","discharging")