Forum Discussion
Time between date
Measure
Var a= calculate (min(table[date],filter(all(table),table[speed]=0))
Var b=calculate (max(table[date],filter(all(table),table[speed]=0))
Return
Datediff(a,b, minute)
Thanks
Pravin
Thanks, that works with my needs!
| Document.Date | Speed |
| 17/02/2020 10:24 | 127 |
| 17/02/2020 10:24 | 130 |
| 17/02/2020 10:24 | 130 |
| 17/02/2020 10:24 | 130 |
| 17/02/2020 10:24 | 130 |
| 17/02/2020 10:24 | 130 |
| 17/02/2020 10:24 | 130 |
| 17/02/2020 10:24 | 90 |
| 17/02/2020 10:24 | 40 |
| 17/02/2020 10:24 | 0 |
| 17/02/2020 10:24 | 0 |
| 17/02/2020 10:25 | 0 |
| 17/02/2020 10:26 | 0 |
| 17/02/2020 10:27 | 0 |
| 17/02/2020 10:28 | 0 |
| 17/02/2020 10:29 | 0 |
| 17/02/2020 10:31 | 0 |
| 17/02/2020 10:32 | 20 |
| 17/02/2020 10:33 | 50 |
| 17/02/2020 10:34 | 100 |
| 17/02/2020 10:35 | 130 |
| 17/02/2020 10:36 | 0 |
| 17/02/2020 10:37 | 0 |
| 17/02/2020 10:38 | 0 |
| 17/02/2020 10:39 | 0 |
| 17/02/2020 10:40 | 0 |
| 17/02/2020 10:41 | 22 |
| 17/02/2020 10:42 | 45 |
In this case, your solution will just take the value 10:24 to 10:40 = 16 minutes. How can I do if I want that it doesn't take 10:32 10:33 and 10:34 and returns me the value = 13 minutes?
Thanks for your help!
- Anonymous6 years agoNot applicable
- admi6 years agoFrequent Visitor
I changed the value in the table.
So the first there is a 0 is at 10:24 and the last time you find a 0 is at 10:40. Thereby, there is 16 minutes between those two dates.
- Anonymous6 years agoNot applicable
Hi admi
I think you want differance between min time and max time having 0
MEasure=
Var Min_time=Calculate(min(table[Date]),all(table[Date]),filter(table,table[Column]=0))
Var Max_time=Calculate(max(table[Date]),all(table[Date]),filter(table,table[Column]=0))
return
Datediff(Min_time,Max_time,minute)
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.