Forum Discussion
AndreiFlorian
6 years agoFrequent Visitor
Find Latest Value from Array
Hi there, I am aware that there are other threads to do with this issue and I have looked over them though I did not manage to make the project work. I have an array called batteryVoltage which stor...
- 6 years ago
Hmm, I am guessing that the last row of data doesn't have a reading. Can you try changing the mesure to this?
Last Battery = VAR _MaxTime = CALCULATE ( MAX ( 'SensoEvents'[TimeStamp] ), KEEPFILTERS ( ALL ( 'SensoEvents'[TimeStamp] ) ) ) RETURN CALCULATE ( SUM ( 'SensoEvent'[Battery] ), 'SensoEvents'[TimeStamp] = _MaxTime )See if keeping the other filters lets us get a result.
jdbuchanan71
6 years agoSuper User
In your sample all the times are the same. How should it determine the "last" time?
| Timestamp | Battery |
|
6/10/19 8:42:06 PM |
0 |
| 6/10/19 8:42:06 PM | 0 |
| 6/10/19 8:42:06 PM | 0 |
| 6/10/19 8:42:06 PM | 3.3 |
| 6/10/19 8:42:06 PM | 3.3 |
| 6/10/19 8:42:06 PM | 3.2 |
| 6/10/19 8:42:06 PM | 3.1 |
AndreiFlorian
6 years agoFrequent Visitor
That’s very odd as when I looked at the dataset, the times were different.
Andrei.
- AndreiFlorian6 years agoFrequent Visitor
Hi, the values were somehow mixed up when I sent them, I worked with the formula a bit and it worket fine.
Thanks for the help!
Andrei.