Days between two dates

Hi!
I have a custom field of the Date type - the date of the ticket distribution in the sprint.
It is necessary to calculate the average time from the creation of the ticket to this date according to the tickets, created by moth.

I imported this field as a measure, but I see the result as “Issues with Sprint Date” and do not understand how I can build my measure of the format “Number of days between the date the ticket was created and the date of distribution in the sprint”
Help me please

Hi @Mitirrol,

I don’t exactly understand how your “Issues with Sprint Date” custom measure functions, so this is not exactly what you are looking for, but it might help you get on the right track.

This is a formula that calculates the time between creation date and Fixed time

    DateDiffdays(
    ([Issue].CurrentHierarchyMember.GetDate('Created at')),
    (CASE WHEN [Resolution].[Resolution].getMemberNameByKey([Issue].CurrentHierarchyMember.get('Resolution ID')) = 'Fixed'
      THEN [Issue].CurrentHierarchyMember.GetDate('Resolved at')
      END)

have a good day,
Marilou

1 Like

Please try creating a new user-defined calculated measure (with decimal formatting) using this formula:

Avg(
Filter(
Descendants([Issue].CurrentHierarchyMember,[Issue].[Issue]),
DateInPeriod(
  [Measures].[Issue Sprint date],
  [Time].CurrentHierarchyMember
)
),
CASE WHEN
[Measures].[Issues with Sprint date]>0
THEN
Datediffdays(
  [Measures].[Issue created date],
  [Measures].[Issue Sprint date]
)
END
)

It would calculate the average difference between the issue created date and sprint date for issues that have sprint date in particular report period in the report.

When selecting this new measure in the report, please enable the "Nonempty " cross join in the report rows.
https://docs.eazybi.com/eazybi/analyze-and-visualize/create-reports#Createreports-Pagedimensions

Martins / eazyBI support