Forum Discussion
emmawdmi22
Helper I
3 years agoTake Max Value in Group Calculation if Multiple Values
In my report, I currently have a working measure called *Max Val (see below). I have several devices that report at every timestamp. The calculation takes the sum of values for the devices at each t...
- 3 years ago
Measure = var a = summarize('Table',[device],[timestamp],"mx",max([Value])) var b = SUMMARIZE(a,[timestamp],"my",var d=[timestamp] return sumx(filter(a,[timestamp]=d),[mx])) return maxx(b,[my])
lbendlin
Super User
3 years ago
I only want to use one reading per device per timestamp.
yes, but which one?
You can do a SUMMARIZE over the deviceID, add a MAXX (value) column for each deviceid, and then do the MAXX over the result.