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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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

✔ Answered? Mark as solution

Muhammad Hasnain | Super User • Fabric • Power BI • Data Engineering

Let's connect on LinkedIn

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors