Average Time of Overdue Issues

We are currently using this formula to get the Overdue issues based on the due date:
[Measures].[Issues with due date]>0 and
isempty([Measures].[Issues not resolved]) and
DateCompare([Measures].[Issue due date],Now())<0

Now we want to get the average time/days the issues are overdue based on the formula above from their due date up to the present. Can you please help us with the formula?

Hi @jeno,

I can’t test this on my side since your formula uses custom measures, but here is what I think would work for you.

First, create a Total Overdue Days measure like this:

    [Measures].[Overdue Issue (your calculated measure here)] > 0
    -- total time from issue due date till now
      [Issue].CurrentHierarchyMember.get('Due date'),

Then, you could create your average

CASE WHEN [Measures].[Overdue Issue (your calculated measure here)] > 0 THEN
  [Measures].[Total Overdue Days] / [Measures].[Overdue Issue (your calculated measure here)]

Let me know how this works for you!

Hi Marilou,

Thank you for your response.

I created the formula based on yours, however, I could not get the data out of it. See results below.
Data not found

Hi @jeno

You were on the right track with the initial formula: iterating through issues is the way to go to get the average (find the overdue time for each issue and calculate the average).
For that, instead of Count(), you would use Avg(). For the average calculation, you need a set of issues and a numerical expression:

  1. the set would be the same as in your Count() calculation (with a few slight changes),
  2. the numerical expression would be the DateDiffDays() calculation between the due date and today, shared by @Marilou

So, the final calculation could be the following:

    Isempty([Measures].[Issue resolution date]) and
    DateCompare([Measures].[Issue due date],Now())<0 and
    ([Measures].[Issues with due date],
      [Issue].CurrentHierarchyMember.get('Due date'),

Remember to set decimal formatting!

Ilze / support@eazybi.com

1 Like