Forum Discussion

awtahhan's avatar
awtahhan
Regular Visitor
5 years ago

How to get the time difference between any 2 rows (consecutive or nonconsecutive)?

Hi,

I have the following data set:

 

The data is sorted and grouped by _objectid_value.
I want to be able to get the datetime diff between any 2 rows consecutavily or not. For example I want to get the datetime diff between each Active and Close events (as per the data in the screenshot, these values could be consecutive or nonconsecutive), how to achieve this?

3 Replies

  • arvindsingh802's avatar
    arvindsingh802
    Icon for Community Champion rankCommunity Champion

    Pivot your data in power query and then take the difference between columns (Active & Close).

     

    If this post helps, then please consider Accept it as the solution and give it a thumbs up

  • awtahhan's avatar
    awtahhan
    Regular Visitor

    I ahve other calculations based on the current structure, is there anyway to accomplish my goal withou pivotting the table? maybe using DAX?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi awtahhan ,

     

    Can you provide an expected result for reference?

     

    Best Regards,

    Stephen Tao

     

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