Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |