# Problem creation time (min. max. and average) for each month + previous months

Hello, please help, what do I need to fix in this script to display the created tasks in the following ratio (Nov → Dec (Nov + Dec) → Jan (Nov + Dec + Jan) → …) and show me the maximum days?
Currently, it shows only each month separately.
Have a nice day, everyone.

``````Max(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
IsEmpty([Measures].[Issue resolution date])
AND
DateInPeriod(
[Measures].[Issue created date],
[Time].CurrentHierarchyMember
)
),
CASE WHEN
[Measures].[Issues created] > 0
THEN
DateDiffDays([Measures].[Issue created date], Now())
END
)
``````

Hi,
Thank you for reaching out!

Currently the Nov 2023 Max time open column shows the longest time open from all tickets that were created in the November 2023.
Dec 2023 column shows longest open time from all tickets that were created in December 2023.

Can you please use your example graph to explain - what number would you want to see in Dec 2023 column with the new logic? Should it be longest days open for issues created in both in November and December? In that case it would show 197.06 in all months.
Or should it be 197.06+170.11=367.17 for Dec 2023? Or should there be some other logic applied?

Kindly,
Ilze

with the new logic, he would like to see MAX from all the tickets

Using the graph example, then it should show the same value 197.06 in all months? (because max open time from November issues will be the oldest when compared to December or January or April)

Kindly,
Ilze

issues should go for every month and from there you can simply calculate the MIN AVG and MAX, you don’t need to add anything
as you said MAX number it will be identical in every month

Hi,
Try the following formula:

``````Max(
Filter(
Descendants([Issue].CurrentMember, [Issue].[Issue]),
IsEmpty([Measures].[Issue resolution date])
AND
DateInPeriod(
[Measures].[Issue created date],
[Time].[6 Month] -- change to your calculated Time member name
)
),
DateDiffDays([Measures].[Issue created date], Now())
)
``````

This formula is based on assumption, that you have filtered the Time period with a calculated member in Time dimension.

Or, another option is to add built-in statistical Max on top of your existing calculation:

This function works with visible rows, so it will return largest value visible in the specific measure column in the report.

I hope this helps.

Kindly,
Ilze