Forum Discussion
Measure to determine time range
How to create a measure to determine if the truck is working(goods delivered) during the window --> (3am to 1pm) ?
I have data for 3 months/20 trucks in the below format and would like to create a report page that shows the performance of the truck by the percentage of times the truck has finished delivery within the above time window or not.
| Truck | Goods delivered | Customer | Date |
| Truck 1 | 1:45 | a | 9/02/2021 |
| Truck 1 | 14:00 | b | 9/02/2021 |
| Truck 2 | 3:45 | c | 10/12/2021 |
| Truck 2 | 4:45 | d | 10/12/2021 |
for example - truck 1 has failed to deliver within the given time window(3am to 1pm), the output should be like below.
truck 1 - 0% and truck 2 - 100%
Any help would be greatly appreciated! Thank you.
Anonymous , Try a measure like
divide(countx(filter(summarize(Table, Table[Truck], "_1",calculate(coutrows(Table), filter(Table,Table[Goods delivered] >=time(3,0,0) && Table[Goods delivered] <=time(13,0,0))),"_2",coutrows(Table)), [_1] =[2]),[Truck]) , distinctcount(Table[Truck]),0)
5 Replies
- AnonymousNot applicable
- amitchandak
Super User
Anonymous , Try a measure like
divide(calculate(coutrows(Table), filter(Table,Table[Goods delivered] >=time(3,0,0) && Table[Goods delivered] <=time(13,0,0))),coutrows(Table))
- AnonymousNot applicable
Sorry i should have been more clear on my requirement.
We have business requirement as below example.
If truck xyz fails to deliver within given time window.. even for 1 customer then it'll be 0% performance for given day.