Forum Discussion

DAX_newbiee's avatar
DAX_newbiee
New Member
2 years ago
Solved

Calculate time between 2 process

Hello Guys,
Need your help in calculating the time between the two process (ABC and XYZ) then add the difference to get a total time difference using DAX measure.
Here is the screenshot

Your help is appreciated.

5 Replies

  • Hi DAX_newbiee ,

    As always, please post a sample data that we can copy-paste (not an image).  Also, you said to get the time between two processes ABC and XYZ but which row/s should be picked?  You mean to get the difference between this datetime to the next datetime for each process?

  • Hi danextian 
    Sorry for the late reply.

    Part_NameDatetimeStationProcesses
    A03-10-2023 20:11ZXYZ
    A03-10-2023 23:42ZABC
    A03-10-2023 23:42ZABC
    A04-10-2023 00:42ZXYZ
    A04-10-2023 03:29ZABC
    A04-10-2023 03:29ZABC
    A05-10-2023 00:26ZXYZ
    A05-10-2023 02:17ZABC
    A05-10-2023 02:17ZABC

     

    Here is the table.
    I want to calculate the time taken by the part A from process XYZ to ABC (example: Subtract 20:11 from 23:42) for XYZ to ABC likewise (subtract 00:42 from  03:29) and so on.
    after calculating the difference add all the difference to get the total time( subtract 1 + subtract 2 + subtract 3).
    I hope it is clear now

    • DAX_newbiee's avatar
      DAX_newbiee
      New Member

      danextian 
      If process is XYZ then to calculate the difference immediate next row, which is having ABC should be picked.
      and always process time is calculated from XYZ to ABC not vice versa.
      Your help would be much appreaciated