Hi @Gabriela_Molitorisz ,
With the requirement to take into account only the first transition, it is necessary to iterate through all issues and determine the first transition date and the duration.
The first and the third requirement seem close enough, so try to adopt the same approach for both of them. For example, below, you can see a formula that will retrieve the average number of days issues spent in the status “To Do” before being transitioned to “In Progress” the first time.
Avg(
Filter(
Descendants([Issue].CurrentMember,[Issue].[Issue]),
-- resolved issues only
Not IsEmpty([Measures].[Issue resolution date])
AND
-- first transition in current period
DateInPeriod(
([Measures].[Transition from status first date],
[Transition].[To Do => In Progress], -- <==== change transition here
[Time].CurrentHierarchy.DefaultMember),
[Time].CurrentHierarchyMember
)
AND
-- numeric measure to tie the dimensions together
([Measures].[Transitions from status],
[Transition].[To Do => In Progress], -- <==== change transition here
[Time].CurrentHierarchy.DefaultMember) > 0
),
-- the difference in days
DateDiffDays(
([Measures].[Transition to status first date],
[Transition Status].[To Do], -- <==== change status here
[Time].CurrentHierarchy.DefaultMember),
([Measures].[Transition from status first date],
[Transition].[To Do => In Progress], -- <==== change transition here
[Time].CurrentHierarchy.DefaultMember)
)
)
Try to change the relevant values to fit your use case.
For the second report, I recommend using the Transition dimension with the three transitions you are interested in rows. Then you can use a calculated measure similar to the one below:
Avg(
Filter(
Descendants([Issue].CurrentMember,[Issue].[Issue]),
-- resolved issues only
Not IsEmpty([Measures].[Issue resolution date])
AND
-- first transition in current period
DateInPeriod(
([Measures].[Transition from status first date],
[Time].CurrentHierarchy.DefaultMember),
[Time].CurrentHierarchyMember
)
AND
-- numeric measure to tie the dimensions together
([Measures].[Transitions from status],
[Time].CurrentHierarchy.DefaultMember) > 0
),
-- the difference in days
DateDiffDays(
([Measures].[Transition to status first date],
[Transition Status].[In Progress], -- <==== change status here
[Transition].DefaultMember,
[Time].CurrentHierarchy.DefaultMember),
([Measures].[Transition from status first date],
[Time].CurrentHierarchy.DefaultMember)
)
)
It will look for issues transitioned out of status “In Progress” and update the formula to “L2 in Progress”.
To get the number of issues, replace the Avg() function with Sum() and move the numeric measure in place of the DateDiffDays() function, which is not necessary for this calculation. To retrieve the number of issues instead of transitions, change the measure to “Transitions from issues count”. See the suggested formula below:
Sum(
Filter(
Descendants([Issue].CurrentMember,[Issue].[Issue]),
Not IsEmpty([Measures].[Issue resolution date])
AND
DateInPeriod(
([Measures].[Transition from status first date],
[Time].CurrentHierarchy.DefaultMember),
[Time].CurrentHierarchyMember
)
),
([Measures].[Transitions from status issues count],
[Time].CurrentHierarchy.DefaultMember)
)
The second report could look similar to the one below:
See the eazyBI documentation page for more details on the functions used in the calculations - MDX Function reference - eazyBI for Jira.
Best,
Roberts // support@eazybi.com