Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Sriku
Helper IV
Helper IV

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 taken to move one another

 

Eg:, If I "Update ticket group" Starting Stage is COE_T and next stage is "All_My" so I want to pick 0.77 days taken, similary, If ticket move to another stage "All_My" to next stage is "DE" time taken is 0.08 days, and so on.

 

Please share knowlege to achieve this

Ticket IDUpdate ticket groupUpdate - TimestampUpdate ticket group - StartUpdate ticket group - NextUpdate ticket group - PrevDays in Ticket groupTicket Indexing
250158COE_T2025-02-26 15:31:34COE_TAll_My 0.771
250158All_My2025-02-27 10:03:53COE_TDECOE_T0.082
250158DE2025-02-27 11:53:41COE_TAll_MyAll_My0.893
250158All_My2025-02-28 09:16:58COE_TDEDE0.024
250158DE2025-02-28 09:44:46COE_TCOE_TAll_My0.015
250158COE_T2025-02-28 09:58:26COE_TAll_MyDE4.016
250158All_My2025-03-04 10:09:44COE_TDECOE_T0.067
250158DE2025-03-04 11:31:55COE_TAll_MyAll_My0.088

 

1 ACCEPTED SOLUTION

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.

View solution in original post

7 REPLIES 7
v-ssriganesh
Community Support
Community Support

Hello @Sriku,
Thank you for reaching out to the Microsoft Fabric Community forum.

I’ve reproduced your scenario successfully using sample data, and the logic works as expected in Power BI Desktop. Please find the .pbix file attached for your reference. I’ve also used the following calculated columns:

  • Get Previous Stage
Previous Stage =

VAR CurrentIndex = 'Tickets'[Ticket Indexing]

VAR CurrentTicket = 'Tickets'[Ticket ID]

RETURN

    CALCULATE(

        MAX('Tickets'[Update ticket group]),

        FILTER(

            'Tickets',

            'Tickets'[Ticket ID] = CurrentTicket &&

            'Tickets'[Ticket Indexing] = CurrentIndex - 1

        )

    )

 

  • Stage Transition
Stage Transition =

'Tickets'[Previous Stage] & " → " & 'Tickets'[Update ticket group]

The Decomposition Tree and Table visual both reflect the correct stage transitions and time durations.


If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

Thanks for your prompt response. But this is not I looking for

Hi @Sriku,

Thanks for the clarification, I appreciate you getting back.

To better assist you, could you please help me understand your exact requirement? Based on your original post, I had assumed you were looking to calculate the time spent in each stage of a ticket and visualize it using the transition (e.g: Stage A → Stage B). However, it seems there’s a different outcome you're aiming for.

Could you please let me know:

  • What is the expected output you would like to see?

  • Are you looking to measure time between specific stages, or something else like tracking duration per ticket or per status?

  • Do you have a sample output format or logic in mind?

Once I have this, I’ll rework the solution and share an updated .pbix file accordingly.

Looking forward to your response.

Thank you.

@v-ssriganesh , I am looking to measure time between start stage to next stage of a particular Ticket, i.e how much time it takes to move from one stage to another

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.

@v-ssriganesh , Thanks for your response. Let me try it out 

mh2587
Super User
Super User

Sum Days from Selected Start Stage = 
VAR SelectedStartStage = SELECTEDVALUE('Tickets'[Update ticket group - Start])
RETURN
SUMX(
    FILTER(
        'Tickets',
        'Tickets'[Update ticket group - Start] = SelectedStartStage &&
        'Tickets'[Update ticket group - Prev] = SelectedStartStage
    ),
    'Tickets'[Days in Ticket group]
)
//Try this one

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.