Forum Discussion
AI14
Helper III
3 years agocompare text to time
Hi i need to see if my Actual is less than my target but they are in different formats. both are measures however 1 has been formatted into HH:MM so its a text and the other is a normal short tim...
- 3 years ago
Hi AI14
try to use TIMEVALUE function to convert Duration to datetime data type as follows
Duration =
VAR _ref =
MAX ( a[REF] )
VAR _time1 =
MAXX ( FILTER ( ALL ( a ), a[REF] = _ref ), [ST] )
VAR _time2 =
MINX ( FILTER ( ALL ( a ), a[REF] = _ref ), [ST] )
RETURN
TIMEVALUE ( FORMAT ( _time2 - _time1, "hh:mm" ) )
FreemanZ
Super User
3 years agohi AI14
try like:
Measure =
IF(
VALUE([Actual])< [Target],
1, 0
)
verified with such data:
Actual = FORMAT(TIME(2,45,0), "hh:mm")
Target = TIME(1,55,0)
FreemanZ
Super User
3 years agochange the target, returns 1
- AI143 years ago
Helper III
also Tried this but says i cant convert value " of type txt to type date
- AI143 years ago
Helper III
the actual:
Duration =VAR _ref = MAX(a[REF])VAR _time1 =MAXX( FILTER( ALL(a), a[REF] = _ref ), [ST])VAR _time2 =MINX( FILTER( ALL(a), a[REF] = _ref ), [ST])RETURNFORMAT(_time2 - _time1, "hh:mm")the Target: (i have this as a measure and a column, both not worked)Target = 'Task Rules'[Earliest Start]+'Task Rules'[Duration]+'Task Rules'[Endbefore]+'Task Rules'[Setup]+'Task Rules'[Cleanup]