# Average time between creation and Fixed

**URL:** <https://community.eazybi.com/t/average-time-between-creation-and-fixed/6965>\
**Category:** Questions & Answers\
**Created:** [May 28, 2021, 12:45pm UTC](https://community.eazybi.com/t/average-time-between-creation-and-fixed/6965 "2021-05-28T12:45:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marilou](https://community.eazybi.com/user_avatar/community.eazybi.com/marilou/32/10252_2.png) [@Marilou](https://community.eazybi.com/u/Marilou)\
**Post date:** [May 28, 2021, 12:45pm UTC](https://community.eazybi.com/t/average-time-between-creation-and-fixed/6965/1 "2021-05-28T12:45:13Z")

</div>

Hi everyone,

I`m trying to calculate the average time between issue creation and when the issue is set to Resolution = Fixed

[measure].[time between creation and fixed]  
I have a Calculate Measure that get the time between creation and Resolution = Fixed. If the issue is not fixed, it calculates time between issue creation and Now.  
I plan on putting resolution in Page to have only issues which are Fixed or Unresolved.

> ```
> Case When      
> isEmpty(DateDiffdays(
> ([Issue].CurrentHierarchyMember.GetDate('Created at')),
> (CASE WHEN [Resolution].[Resolution].getMemberNameByKey([Issue].CurrentHierarchyMember.get('Resolution ID')) = 'Fixed'
> THEN [Issue].CurrentHierarchyMember.GetDate('Resolved at')
> END)
> )) THEN
> DateDiffdays(
> ([Issue].CurrentHierarchyMember.GetDate('Created at')),
> NOW()
> )
> ELSE
> DateDiffdays(
> ([Issue].CurrentHierarchyMember.GetDate('Created at')),
> (CASE WHEN [Resolution].[Resolution].getMemberNameByKey([Issue].CurrentHierarchyMember.get('Resolution ID')) = 'Fixed'
> THEN [Issue].CurrentHierarchyMember.GetDate('Resolved at')
> END)
> )END
> 
> ```

This measure seems to work fine.

[Measure].[Average time between creation and Fixed]  
Then I used the previous measure to create my average.

> NonZero(  
> Avg(  
> Filter(  
> Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),  
> [Measures].[time between creation and Fixed]\>0  
> )  
> ,  
> [Measures].[time between creation and Fixed]  
> ))

My problem is that no matter what is in Pages or in Row (other than individual issues) I always get the same result for my average

![image](https://community.eazybi.com/uploads/default/original/2X/4/4609227eaeda3466b74315ba443b6cbbae88732d.png)

![image](https://community.eazybi.com/uploads/default/original/2X/e/eff14c125d45d38cc44151482cca18cae01634d7.png)

Can someone help me find the error(s) in my measure or reasoning?  
Thanks

---

<div class="post-metadata">

**Author:** ![Marilou](https://community.eazybi.com/user_avatar/community.eazybi.com/marilou/32/10252_2.png) [@Marilou](https://community.eazybi.com/u/Marilou)\
**Post date:** [May 31, 2021, 2:06pm UTC](https://community.eazybi.com/t/average-time-between-creation-and-fixed/6965/2 "2021-05-31T14:06:33Z")

</div>

Thank you @janis.plume for replying to my email!

Posting the answer here so everyone can benefit from it

"  
Such behavior is because the “time between creation and fixed” is based on the issue properties, and those cannot adjust to the report page filter. The properties work only for individual issues, and you need to use a measure for the filters to work.

Please, try adjusting the average calculation with an additional condition:

> NonZero(
> 
> Avg(
> 
> Filter(
> 
> Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
> 
> [Measures].[time between creation and Fixed]\>0
> 
> AND
> 
> [Measures].[Issues created]\>0
> 
> )
> 
> ,
> 
> [Measures].[time between creation and Fixed]  
> "
