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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
How calculate the difference time between 11:54:00 PM and 12:09:00 AM in power bi?
Solved! Go to Solution.
Hi, @Tahmineh1989
You can try the following methods.
Column:
LongTime1 = [Date]&" "&[Time1]
LongTime2 =
Var _lastdate=MAXX(FILTER('Table',[LongTime1]>EARLIER('Table'[LongTime1])),[Date])
Return
IF(_lastdate=BLANK(),BLANK(),_lastdate&" "&[Time2])
Change the format of the column from text to datetime.
Diff = DATEDIFF([LongTime1],[LongTime2],MINUTE)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Still, there is the problem. I changed the time format to Number, but it did not work.
Hi, @Tahmineh1989
You can try the following methods.
Column:
MINUTE = DATEDIFF([Time1],[Time2],MINUTE)
Is this the result you expect?
DATEDIFF function (DAX) - DAX | Microsoft Learn
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I did what you said. But the value of -1425 is wrong. The duration between 11:51:08 PM on 22 June and 12:06:08 AM on 23 June is 15 min. Why does it show this huge amount?
Hi, @Tahmineh1989
You can try the following methods.
Column:
LongTime1 = [Date]&" "&[Time1]
LongTime2 =
Var _lastdate=MAXX(FILTER('Table',[LongTime1]>EARLIER('Table'[LongTime1])),[Date])
Return
IF(_lastdate=BLANK(),BLANK(),_lastdate&" "&[Time2])
Change the format of the column from text to datetime.
Diff = DATEDIFF([LongTime1],[LongTime2],MINUTE)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If the end time is earlier in the (next) day, you can +1 to the difference. This article may have some good other info on working with times/durations in Power BI.
Calculate and Format Durations in DAX – Hoosier BI
Pat
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.