Forum Discussion
Anonymous
5 years agoNot applicable
If Statement with Date and Time Format
Hello, Need Help with an If statement that includes all of the following factors below. I want to calculate the following If the Driver pick up (Time) is 15 mins <= to the scheduled arrival ...
- 5 years ago
Hi Anonymous,
Try measure as:
Measure = IF( DATEDIFF(MAX('Table'[Driver Pick up Time]),MAX('Table'[Schedule Arrival Time]),MINUTE)<=15 && DATEDIFF(MAX('Table'[Driver Pick up Time]),MAX('Table'[Schedule Arrival Time]),MINUTE)>=0, "on time", IF( DATEDIFF(MAX('Table'[Driver Pick up Time]),MAX('Table'[Schedule Arrival Time]),MINUTE)>=16, "Early", "Late" ) )Here is the output:
The pbix file is attached.
Best Regards,
LinkIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
v-xulin-mstf
Community Support
5 years agoHi Anonymous,
Try measure as:
Measure =
IF(
DATEDIFF(MAX('Table'[Driver Pick up Time]),MAX('Table'[Schedule Arrival Time]),MINUTE)<=15 && DATEDIFF(MAX('Table'[Driver Pick up Time]),MAX('Table'[Schedule Arrival Time]),MINUTE)>=0,
"on time",
IF(
DATEDIFF(MAX('Table'[Driver Pick up Time]),MAX('Table'[Schedule Arrival Time]),MINUTE)>=16,
"Early",
"Late"
)
)
Here is the output:
The pbix file is attached.
Best Regards,
Link
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years agoNot applicable
This is perfect thank you!!!