Arithmetic expression does not have valid input types

Hello,

What am I doing wrong with this expression?

Thank you.
Tiffany

I believe, you may wish to convert part of expression from duration to number or decimal type by wrapping it by say TOTALHOURS()

So, please try to wrap following expression with TOTALHOURS() something like below
IF( TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route]))) < -1,

TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route])))* (-1),
TOTALHOURS([Driver Timestamp] - ANY(SELECT(delineatedLocations[Driver Timestamp], [Route]=[_THISROW].[Route])))
)

Edit: The above suggestion to wrap by TOTALHOURS() is based on assumptio that the difference between two timestamps is of the order of hours. This is so because the expression has number 1 in comparison part. If the difference is going to be always in minutes , then the expression could be wrapped with TOTALMINUTES() function as well.

2 Likes