Forum Discussion

suji's avatar
suji
Advocate I
9 years ago
Solved

validate current timestamp between given start and end date times

Hi,   I have to validate current timestamp between given start and end date times on Power BI Desktop.     Thanks & Regards, Suresh Peddirsi,
  • Baskar's avatar
    Baskar
    9 years ago

    Don't worry dude we have another one way

     

    Time Difference =
    var Start_Date = NOW()  -- Replace Now() with start_date 
    var end_Date = NOW()    -- Replace Now() with end_date 

    var Start_time = FORMAT(Start_Date,"HH:mm:ss")
    var End_time = FORMAT(end_Date,"HH:mm:ss")

    return FORMAT( TIME(LEFT(Start_time,2) ,MID(Start_time,4,2),RIGHT(Start_time,2)) -
    TIME(LEFT(End_time,2) ,MID(End_time,4,2),RIGHT(End_time,2)) , "HH:mm:ss"
    )

     

     

    I hope it will give u the time difference dude..

     

     

    let me know any further doubts . cheers