Hi,
We need to measure a KPI defined as : average number of days between the arrival of an issue and the resolution of some subtasks.
I know that it’s a rather convulated way to calculate an “Average time to resolution” …
The start date is defined as :
CASE WHEN NOT IsEmpty([Issue].CurrentHierarchyMember.Get(‘Date entrée TAC’))
THEN [Issue].CurrentHierarchyMember.Get(‘Date entrée PORT’)
ELSE [Issue].CurrentHierarchyMember.Get(‘Date de réception’)
END
If the issue has a ‘Date entrée TAC’, we use ‘Date entrée PORT’, else we use ‘Date de réception’
The ending date is defined as :
CASE WHEN
Count(
Filter(
Filter(
[Issue].[Issue].GetMembersByKeys([Issue].CurrentHierarchyMember.Get(‘Sub-task keys’)),
[Issue].[Issue].CurrentHierarchyMember.get(‘Type Sous-Tache’) = ‘Contrat FTC’
OR [Issue].[Issue].CurrentHierarchyMember.get(‘Type Sous-Tache’) = ‘Contrat FGI’
OR [Issue].[Issue].CurrentHierarchyMember.get(‘Type Sous-Tache’) = ‘Tarif FGI’
),
IsEmpty([Issue].[Issue].CurrentHierarchyMember.get(‘Resolved at’))
)
) = 0
THEN
TimestampToDate(
Max(
Filter(
[Issue].[Issue].GetMembersByKeys([Issue].CurrentHierarchyMember.Get(‘Sub-task keys’)),
[Issue].[Issue].CurrentHierarchyMember.get(‘Type Sous-Tache’) = ‘Contrat FTC’
OR [Issue].[Issue].CurrentHierarchyMember.get(‘Type Sous-Tache’) = ‘Contrat FGI’
OR [Issue].[Issue].CurrentHierarchyMember.get(‘Type Sous-Tache’) = ‘Tarif FGI’
),
DateToTimestamp([Issue].CurrentHierarchyMember.Get(‘Resolved at’))
)
END
We only take the issues having every subtasks on the type ‘Contrat FTC’, ‘Contrat FGI’ and ‘Tarif FGI’ closed.
On this issues, we take the resolution date of the last resolved subtask.
So, I created 2 measures : one for the start date and another for the end date.This works.
BUT, I can’t create another measure calcultaing the number of workdays between those dates (the result is empty).
So, I created a measure including all of the above in :
Avg([Issue].Members,
DateDiffWorkdays(
StartDate,
EndDate,
))
Problem is : it’s slow when it doesn’t just time out.
How could I make it all work faster ?
Thanks !
Regards.