I'm getting negative value as a output,

Hi Team,

I have define new calculated members to get the age of tickets,but I’m getting negative value in output. Below is the query

Descendants([Issue].CurrentMember, [Issue].[Issue]),
[Measures].[Open issues] > 0 OR [Measures].[Issues closed] > 0),
Case when isempty([Measures].[Issue closed date])
Case when
[Measures].[Issue created date],
[Time].CurrentHierarchyMember) AND DateDiffWorkDays(
[Time].CurrentHierarchyMember.NextStartDate, Now())>0
DateDiffWorkDays([Measures].[Issue created date],
DateDiffWorkDays([Measures].[Issue created date],Now())
DateDiffWorkDays([Measures].[Issue created date],
[Measures].[Issue closed date])
end ))

I would like to know where I’m wrong / where i need to add up some stuff

You are using two different ways for filtering issues, that could lead to inconsistent results in some cases.

You are using measures Open issues and Issues closed. Measure open issues stop counting any issue as open based on resolution date. If you do not have resolution date or you have a gap between resolving an issue and closing an issue the formula might pick the wrong set of issues.

You would like to use either metrics based on Resolution date in the formula or create a new calculated measure Open issues by closed or similar using the formula of Open issues and substituting metrics based on resolution date with metrics based on the closing date.

I also noticed that the formula calculates the cumulative age for issues without closing date and total time for closed issues. If you would like to calculate the cumulative time till closing or resolution you can check out quite the similar formula Average days till resolution or period end in our example report from demo account:

This formula calculates the cumulative age for open issues till resolution or till the period end.

Daina / support@eazybi.com