Forum Discussion
Help with Measure
- 8 years ago
Hi Anonymous,
glad it worked out for you. For formatting the result, you may find these additional measures useful:
DiffMinutes = QUOTIENT([Diff], 60) DiffSeconds = [Diff] - [DiffMinutes] * 60 DiffMinSec = [DiffMinutes] & "." & FORMAT([DiffSeconds],"00")
If all you need is the [DiffMinSec] you can fold it together as:
DiffMinSec = QUOTIENT([Diff], 60) & "." & FORMAT([Diff] - QUOTIENT([Diff], 60) * 60,"00")
Hi erik_tarnvik
I am looking for the Exact result that you have shown, But When I tried it for Seconds for some reason I am not getting accurate results(as you can see seconds are not correct).Here is the exact data used given in the Image, I am unable to upload files in here:(
| Timestamp | list.list.assetState.name |
| 9/27/2017 10:11 | isMotion |
| 9/27/2017 10:12 | isNoMotion |
| 9/27/2017 10:15 | isMotion |
| 9/27/2017 10:16 | isNoMotion |
| 9/27/2017 10:19 | isMotion |
| 9/27/2017 10:24 | isNoMotion |
| 9/27/2017 10:24 | isMotion |
| 9/27/2017 10:31 | isNoMotion |
| 9/27/2017 10:31 | isMotion |
| 9/27/2017 10:38 | isNoMotion |
| 9/27/2017 10:39 | isMotion |
| 9/27/2017 10:42 | isNoMotion |
| 9/27/2017 10:42 | isMotion |
| 9/27/2017 10:44 | isNoMotion |
| 9/27/2017 10:44 | isMotion |
Try changing the line
FILTER(ALL('Events (3)'),to
FILTER(ALLSELECTED('Events (3)'),in your measure. What happens here is that the ALL() clears all filters on your event table no matter where they are coming from. ALLSELECTED however will clear the filters in your table but not the one in the slicer I see you have on the events table. So you most likely are getting the wrong result beacuse the measure will "see" ALL events in the table, not just the ones you have selected with the slicer.
Let me know if this solves the problem.
- Anonymous8 years agoNot applicable
Hi erik_tarnvik
Thanks, I am getting the result now. But there is just one more thing, Is it Possible to get the exact time difference with Minutes and seconds(m.s) for eg. 4.50 where 4 is minute and 50 is seconds both of which is derived from the difference in date times.
Thanks,
Ravi Shankar D
- erik_tarnvik8 years agoSolution Specialist
Hi Anonymous,
glad it worked out for you. For formatting the result, you may find these additional measures useful:
DiffMinutes = QUOTIENT([Diff], 60) DiffSeconds = [Diff] - [DiffMinutes] * 60 DiffMinSec = [DiffMinutes] & "." & FORMAT([DiffSeconds],"00")
If all you need is the [DiffMinSec] you can fold it together as:
DiffMinSec = QUOTIENT([Diff], 60) & "." & FORMAT([Diff] - QUOTIENT([Diff], 60) * 60,"00")
- Anonymous8 years agoNot applicable
Thanks a lot erik_tarnvik and everyone who helped in forming this calculation.
I will check and let you know if I find any bugs erik_tarnvik