Measuring net time of resolution

Hi,

I’m struggling to create a report that unlike the sample reports for cycle/lead time of issues, excludes the time spent in passive statuses, before the item satisfies the ready for development status.
We have a discovery and shaping process, where a ticket starts as new and transitions through drafting and shaping phases till we declare it is ready for development. At that moment it becomes a proper development item.
In concrete terms, for bugs we have the following preparatory statuses:
[BUG] NEW BUG,
[BUG] In Triage,
[BUG] DRAFTING
They all fall under the “To Do” status category

[BUG] Awaiting DEV is the first active state and it’s still in the To Do category

There are also other active states which belong to the In Progress category:
[BUG] IN DEV
[BUG] AWAITING PR
[BUG] AWAITING RELEASE TO FT
[BUG] AWAITING FT
[BUG] IN FEATURE TESTING
[BUG] BLOCKED IN DEV
[BUG] BLOCKED IN FT

and finally we have the Done statuses:
[BUG] Closed and [BUG] Done

What I need to measure is the sum of the times in the statuses which we consider active.
Unfortunately, it can’t be a simple diff between the status Bug Closed/Done and BUG awaiting dev, because sometimes developers migrate the bug straight in the BUG In dev status, skipping the BUG awaiting dev, or a bug is closed as rejected in triage without ever spending a moment in the active states.

So, the report that I need should show months on the X-Axis and Count of issues resolved and average net resolution time on Y-axis. I will limit the report with Priority filter so I can select P1s, P2s or both.
I tried this calculated measure that always returns zero records as soon as I add the issue name to be bug:
Sum(
Filter(
DescendantsSet([Issue].CurrentMember, [Issue].[Issue]),
[Measures].[Issues resolved] > 0
AND [Issue Type].CurrentMember IS [Issue Type].[Bug]
),
[Measures].[Total resolution days] -
Sum(
{[Transition Status].[[[BUG]] NEW BUG],
[Transition Status].[[BUG]] In Triage],
[Transition Status].[[BUG]] DRAFTING]},
[Measures].[Days in transition status]
)
)
I also tried aggregating transition statuses in one “Active” but the results never matched accurately the times that I calculated by hand.

Any ideas how to accomplish?

P.S. I would rather not show issues that transition from any of the preparatory statuses to the final statuses.

P.S. P.S. I would rather not show issues that transition directly from any of the preparatory statuses to the final statuses.