Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 time.
e.g.
the text time measure is as follows: Actual= Format(example),"hh:mm) - result is 02.45
the Target measure might say 03:55 (in short time format)
the if formula is not working due to formatting issues :
if(actual<target,1,0)
please assist
Solved! Go to Solution.
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" ) )
Tried this but says i cant convert value " of type txt to type date
hi @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)
change the target, returns 1
also Tried this but says i cant convert value " of type txt to type date
the actual:
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" ) )
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |