Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi
Is there a formula to compare 2 times if less than or more than a fixed time for example,
Actual 09:59
Target 10:00
if Actual is less than Target by 10 mins then 1 if not 0
For this we will convert your time to DateTime using the TimeValue and then calculate minutes using DateDiff.
DATEDIFF (TIMEVALUE(time_text) ,TIMEVALUE(time_text) ,MINUTE)
Then build your switch statement or if statement for the logic. Many ways to do this, but here are a few...
SWITCH(TRUE()
,DATEDIFF (TIMEVALUE(time_text) ,TIMEVALUE(time_text) ,MINUTE) > 10, 1
,0)
IF(DATEDIFF (TIMEVALUE(time_text) ,TIMEVALUE(time_text) ,MINUTE)>10,1,0)
Thanks,
Would i need to add a < to say if its less than?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |