Time between to actions

Please check if you can use issue property, for example, Issue closed date or Issue resolution date as a filter and the last date representing a move to status Done. If this is the case, you can use the example I just shared above using Closed date (switch to any other issue property, if needed here).

If you do not have an issue property to represent the last date to some status you can consider precalculating it with JavaScript calculated custom fields. You can check out this community topic to get the date of some status change. The code calculates the first date to some status. You can use it as an inspiration and modify the code to get the last date:

If this does not work for you, you can use historical date measures. I would suggest using Issue properties as only filters and move filters by measures to AVG numeric expression part. However, it might impact the performance of the report significantly. I would suggest using Issue properties as only filters to improve a prformance as much as possible and move filters by measures to AVG numeric expression part:

NonZero(
  Avg(
    Filter(
      Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
       [Measures].[Issue status] MATCHES "Closed|Done"
    ),
    Case WHEN
      DateInPeriod(
        (
          [Measures].[Transition to status last date],
          [Transition Status].[Done],
          [Time].CurrentHierarchy.DefaultMember
        ),
          [Time].CurrentHierarchyMember
      )
    THEN
    DateDiffworkdays(
      (
        [Measures].[Transition to status first date],
        [Transition Status].[In Progress],
        [Time].CurrentHierarchy.DefaultMember
      ),
      (
        [Measures].[Transition to status last date],
        [Transition Status].[Done],
        [Time].CurrentHierarchy.DefaultMember
      )
    )
    END
  )
)

Daina / support@eazybi.com