Forum Discussion
Find Latest Value from Array
- 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.
Thank you!
My bad, I was not aware that 'Table' had to be replaced with the name of the dataset, I am getting (blank) as the value of the field though.
Andrei.
- jdbuchanan716 years agoSuper User
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.
- AndreiFlorian6 years agoFrequent Visitor
Hi, I got the same result, I have changed the source of the data to an excel document and added the link to the report below. Maybe you could check that out. The dataset looks a bit different but contains the same data
Power Bi - https://1drv.ms/u/s!AgtzRKJQT-Ongsxs6L1-Sr1LeoSUpA?e=6VBTTE
Dataset - https://1drv.ms/u/s!AgtzRKJQT-OngsxrKxKlv1sj1x7tsQ?e=cjckhe
Andrei.
- jdbuchanan716 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