Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Counting proper time between dates of order

Hi! 

I have some problems with my Power BI formulas and i dont know how to obtain the proper result. I will show you my file below.
.

Venqui_0-1628171739268.png

.

  1. First column there are order numbers,
  2. Second one doesn't matter,
  3. Third is showing the correct date,
  4. Fourth and fifth is a split date from 3rd column,
  5. 6th (supporting column) groups the same number of orders with the same number like in this case 999779,
  6. 8th (index1) sorts date from lowest to highes date. (earlier -> later).

 

I would like to get a result (proper time) between every step in this order. So example count time from the end of order (index1 = 4) and step (index1 = 3), step (index1  = 3) and step (index 1 =  2). I tried but results are'n enough accurate.

 

Example (index1 = 2 and index1 = 1)
Between First row  (date column) and second row (date column) is in my file 16 seconds. From mathematical point of view is 3 sec (8:46:25 - 8:46:22). 

I found this kind of formula and I tried to fit it to my case, but the results are not exact the same.  

 

Days = MAX(0,CALCULATE(MIN(Lookup1[Date]),FILTER(Lookup1,Lookup1[Supporting Column]=EARLIER(Lookup1[Supporting Column])&&Lookup1[index1]>EARLIER(Lookup1[index1])))-Lookup1[Date])


and after that:

 

Seconds = Lookup1[Days]*24*60*60

and after that: 
 
Proper Time =

RIGHT ( "0" & INT ( Lookup1[Seconds]/ 3600 ), 2 )

& ":"

& RIGHT (

"0"

& INT ( ( Lookup1[Seconds] - INT (Lookup1[Seconds] / 3600 ) * 3600 ) / 60 ),

2

)

& ":"

& RIGHT ( "0" & MOD (Lookup1[Seconds], 3600 ), 2 )
 
 
any ideas how to solve it or chnage days formula for more accurate ?? 

Thanks for your help! I hope that i explained it well. 






2 REPLIES 2
Anonymous
Not applicable

lbendlin
Super User
Super User

Please provide sample data in usable format (not as a picture).

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors