Average age of open issues that were created this year to date

Hi,

I am trying to show the average age of open issues - but only for issues that were opened since 1st Jan 2022 onwards.
I have been using the ‘Average age’ as shown on the demo page here: Average age report - Issues - Jira Demo - eazyBI

But I cant seem to find a way to limit it to just issues created this year to date. Am I missing something silly?

Thanks very much

Hi @Metrix

Welcome to the Community! :slight_smile:

You can introduce an additional condition with the DateInPeriod function to check whether the creation date is in the period of the current year:

DateInPeriod([Issue].CurrentMember.get('Created at'),[Time].[Current year])

Added in the formula of “Average age of Open issues” measure it would look like this:

CASE WHEN [Measures].[Open issues] > 0 THEN
  Avg(
    Filter(Descendants([Issue].CurrentMember, [Issue].[Issue]),
      -- filter open issues in period using issue properties Created date and Resolution date only
      DateInPeriod([Issue].CurrentMember.get('Created at'),[Time].[Current year])
      AND
      DateBeforePeriodEnd(
        [Issue].CurrentMember.get('Created at'),
        [Time].CurrentHierarchyMember) AND
      NOT DateBeforePeriodEnd(
        [Issue].CurrentMember.get('Resolved at'),
        [Time].CurrentHierarchyMember)
      ),
    CASE WHEN
    ([Measures].[Issues created],
    [Time].CurrentHierarchy.DefaultMember) > 0
    THEN
    -- cumulative age of each issue for any period till end of period or till today
      CASE WHEN DateInPeriod(Now(), [Time].CurrentHierarchyMember)
      THEN DateDiffDays([Issue].CurrentMember.get('Created at'),
        Now())
      ELSE DateDiffDays([Issue].CurrentMember.get('Created at'),
        [Time].CurrentHierarchyMember.NextStartDate)
      END
    END
  )
END

Best regards,
Nauris / eazyBI support

This worked perfectly, thanks very much!