Forum Discussion

Sriku's avatar
Sriku
Helper IV
1 year ago
Solved

Decomposition tree stage value reference

Hi,  I want to pick the earlier stage and calculate sum of "Days in Ticket group", on selection filter on "Update ticket group - Start", and sort "Update - Timestamp" from , I want to pick the daya...
  • v-ssriganesh's avatar
    v-ssriganesh
    1 year ago

    Hi Sriku,
    Thank you for the clarification.

    Based on your updated requirement, calculating the time it takes for a ticket to move from one stage to the next. I’ve revised the approach accordingly.

    I’ve added two new calculated columns:

    • Previous Update Timestamp

    This finds the timestamp of the previous stage within the same ticket.

    Previous Update Timestamp =
    
    VAR CurrentIndex = 'Tickets'[Ticket Indexing]
    
    VAR CurrentTicket = 'Tickets'[Ticket ID]
    
    RETURN
    
        CALCULATE(
    
            MAX('Tickets'[Update - Timestamp]),
    
            FILTER(
    
                'Tickets',
    
                'Tickets'[Ticket ID] = CurrentTicket &&
    
                'Tickets'[Ticket Indexing] = CurrentIndex - 1
    
            )
    
        )

     

    • Time Between Stages (Hours)

    This calculates the duration between the current and previous stage transitions.

    Time Between Stages (Hours) =
    
    VAR PrevTime = 'Tickets'[Previous Update Timestamp]
    
    VAR CurrTime = 'Tickets'[Update - Timestamp]
    
    RETURN
    
        IF(
    
            NOT ISBLANK(PrevTime),
    
            DATEDIFF(PrevTime, CurrTime, HOUR)
    
        )

    I’ve also attached an updated .pbix file for your reference. Please feel free to test it.


    I trust this information proves useful. If it does, kindly “Accept as solution” and give it a 'Kudos' to help others locate it easily.
    Thank you.