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
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?
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |