Thank you for the reply .
We that i have another condition the case is below
I have a case that I only want to have avg time for the tickets in “in progress ” state before they moved to a state for the first time
“2nd level “ and not all tickets move to 2nd level .
in this case i want to have average no of time the ticket was in in progress state before it moved to 2nd level in each month .
Please see the suggestions from our internal discussion below:
You can use the measure “Average days in transition status” with the specific Transition dimension member. In your case, you can create a new calculated measure that forms a tuple. Use the measure “Average days in transition status” and the Transition dimension member “In Progress => 2nd level”. See the formula below:
([Measures].[Average days in transitions status], [Transition].[In Progress => 2nd level])
See a picture of a sample report below:
The "AVG days “In Progress => In Review” displays the average number of days issues spent in the status “In Progress” before being transitioned to the status “In Review”. The number of days is displayed in the period the transition happened.
Filter(
Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
-- filter with measure to pick issues based on dimension usage in the report and validation if issue has a transition from status In progress
([Measures].[Transitions from status],
[Transition Status].[In Progress])>0
AND
-- filter by issue transition date from status In progress
DateInPeriod(
([Measures].[Transition from status first date],
[Transition Status].[In Progress],
[Time].CurrentHierarchy.DefaultMember),
[Time].CurrentHierarchyMember
)
),
-- calculated time in days between first transition date to status In progress and first transition to status Done:
DateDiffDays(
([Measures].[Transition to status first date],
[Transition Status].[In Progress],
[Time].CurrentHierarchy.DefaultMember),
([Measures].[Transition to status first date],
[Transition Status].[2nd level],
[Time].CurrentHierarchy.DefaultMember)
)
)
the above mdx somehow provided the result but this is showing me result in negative . Can you tell how i can just elemenate the negative or the query could only give result where difference is in positive .
The number may be negative because some issues transitioned to the status “2nd level” first and only then to “In Progress”. To overcome this, you can enclose the DateDiffDays() calculation inside the Abs() function. That way, the returned number will always be positive.