Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

sum of datediff

*sorry about the confusion,
updated with a table.
 
gate hours = DATEDIFF([min entered yard],[max exit yard],HOUR)
i want to sum gate hour by week.
however is taking the difference from [min entered yard] from 6/14 to [max exit yard] of 6/19.
instead of adding each day's gate hours together.
the gate hour i want for WeekNo 24 should be 14+15+15+15+11+9 = 79
not 128.

 

 

Greg_Deckler 

 

 
  • Hi Anonymous ,

     

    Please use the following measure for gate hours:

     

    gate hours new = SUMX(VALUES(Table[Dt]),DATEDIFF([min entered yard],[max exit yard],HOUR))

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regards,

    Dedmon Dai

2 Replies