Forum Discussion

prasadhebbar315's avatar
prasadhebbar315
Icon for Advocate I rankAdvocate I
3 years ago
Solved

Days between case closed to case reopen for the same device

Hello everyone, I am working on a problem where I need to identify days between Case Closed and Case Reopen for the same device. This is a problem in contact center where an agent creates a service ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  prasadhebbar315 ,

     

    Here are the steps you can follow:

    1. Create calculated column.

    Days_to_Close =
    DATEDIFF(
        'Table'[Service_Open_Date],'Table'[Service_Closed_Date],DAY)+1
    Reopen_Days =
    var _LastOpen=
    MAXX(
        FILTER(ALL('Table'),
        'Table'[Device_Number]=EARLIER('Table'[Device_Number])&&'Table'[Service_Open_Date]<EARLIER('Table'[Service_Open_Date])),[Service_Open_Date])
    var _LastClose=
    MAXX(
        FILTER(ALL('Table'),'Table'[Service_Open_Date]=_LastOpen),'Table'[Service_Closed_Date])
    return
    DATEDIFF(
       _LastClose,'Table'[Service_Open_Date],DAY)

    2. Result:

     

    Best Regards,

    Liu Yang

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