how to write measured field for avarage workdays spent in status x for specific status and include the issues that were at status x at some point or still at that status
Hi, @iclalaslan
Welcom to the eazyBI community.
To create a calculated measure that shows the average workdays spent in a specific status (including both issues that have left the status and those currently in it), please consider using a Descendants().
For the issues that have been transitioned from the status, please use the measure “Workdays in transition status,” and for those who haven’t transitioned out of the status, calculate workdays from the last transition to the status until now using DateDiffWorkdays()
The formula should look something like this:
Avg(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
[Measures].[Transitions to status] > 0
),
CASE WHEN
[Measures].[Transitions from status] > 0
THEN
[Measures].[Workdays in transition status]
ELSE
-- For issues still in status, calculate workdays till now
DateDiffWorkdays(
[Measures].[Transition to status last date],
Now()
)
END
)
Kindly,
Ilze