Forum Discussion

Rmilczarek's avatar
Rmilczarek
Helper I
8 years ago

Average Backlog Age by Month

In a prior post, I was helped considerably in grouping a list of cases in "Age Bands" by month for the month in which the case was Open (i.e. not closed).  The graph worked well and I got something looking like this:

 

 

Now however I need to add a line to the above chart that shows the Average Age of ALL cases that were Open in that month, rather than just counting how many had been open for 30 days, 60 days, etc.  

 

I used a modified version of one of the "time band" formulas to come up with the total cases that were Open in a given month:

 

Total Active = CALCULATE(COUNT(Backlog[CaseNumber]), FILTER(ALLSELECTED(Backlog),
Backlog[CreatedDate] < 'Month'[MonthEnd] && Backlog[Adj_ClosedDate] > 'Month'[MonthEnd]))

 

That seems to get me what I need for a total count of cases, but how do I figure out an Average Age for all the cases included in that count for that month?

5 Replies

    • Rmilczarek's avatar
      Rmilczarek
      Helper I

      Here is some sample data.  It's basically CaseID, DateOpened and DateClosed for each case:

       

      CaseIDDateOpenedDateClosed
      100712/28/20161/15/2017
      100812/29/20162/15/2017
      10091/1/20171/15/2017
      10101/1/20172/15/2017
      10111/15/20172/10/2017
      10121/26/20171/28/2017
      10131/31/20171/31/2017
      10142/5/20172/9/2017
      10152/25/20172/28/2017
      10162/25/20173/1/2017
      10172/28/20173/1/2017
      10182/28/20175/26/2017
      10193/1/20173/27/2017
      10203/5/20173/21/2017
      10213/26/20174/2/2017
      10223/28/2017 
      10234/15/20174/16/2017
      10244/19/20176/19/2017
      10254/30/20177/30/2017
      10265/25/20176/2/2017
      10276/2/2017 
      10286/10/20176/21/2017
      10296/25/2017 
      10307/14/201716-Oct
      10318/21/20178/22/2017
      10328/23/20178/25/2017
      10339/1/20179/1/2017
      10349/3/20179/30/2017
      10359/5/201710/12/2017
      10369/5/201710/5/2017
      10379/10/201711/21/2017
      10389/12/2017 
      10399/26/201712/1/2017
      10409/30/201711/15/2017
      10419/30/201710/1/2017
      104210/11/201710/31/2017
      104310/12/201711/3/2017
      104410/15/2017 
      104510/24/2017 
      104610/26/201710/27/2017
      104710/29/2017 
      104810/30/2017 
      104910/31/201711/15/2017
      105010/31/2017 

       

      When I look at this data in Excel, I can easily create a formula that will check to see the following for each case for the END of a given month:

      • Was the Case opened before the end date for that month?
      • Is the Case still Open?  If so, subtract the DateOpened from the End of Month date.
      • If there is a DateClosed, is that date later than the End date for that Month?  If so, subtract the DateOpened from the End of Month date.

      Using this data, I can create the following matrix:

       

         Age of any Case Still Open at Months End
      CaseIDDateOpenedDateClosed1/31/20172/28/20173/31/20174/30/20175/31/20176/30/20177/31/20178/31/20179/30/201710/31/201711/30/201712/31/2017
      100712/28/20161/15/2017------------
      100812/29/20162/15/201733-----------
      10091/1/20171/15/2017------------
      10101/1/20172/15/201730-----------
      10111/15/20172/10/201716-----------
      10121/26/20171/28/2017------------
      10131/31/20171/31/2017------------
      10142/5/20172/9/2017------------
      10152/25/20172/28/2017------------
      10162/25/20173/1/2017-3----------
      10172/28/20173/1/2017-0----------
      10182/28/20175/26/2017-03161--------
      10193/1/20173/27/2017------------
      10203/5/20173/21/2017------------
      10213/26/20174/2/2017--5---------
      10223/28/2017 --3336494125156186217247278
      10234/15/20174/16/2017------------
      10244/19/20176/19/2017---1142-------
      10254/30/20177/30/2017---03161------
      10265/25/20176/2/2017----6-------
      10276/2/2017 -----285990120151181212
      10286/10/20176/21/2017------------
      10296/25/2017 -----5366797128158189
      10307/14/201716-Oct------174878---
      10318/21/20178/22/2017------------
      10328/23/20178/25/2017------------
      10339/1/20179/1/2017------------
      10349/3/20179/30/2017------------
      10359/5/201710/12/2017--------25---
      10369/5/201710/5/2017--------25---
      10379/10/201711/21/2017--------2051--
      10389/12/2017 --------184979110
      10399/26/201712/1/2017--------43565-
      10409/30/201711/15/2017--------031--
      10419/30/201710/1/2017--------0---
      104210/11/201710/31/2017------------
      104310/12/201711/3/2017---------19--
      104410/15/2017 ---------164677
      104510/24/2017 ---------73768
      104610/26/201710/27/2017------------
      104710/29/2017 ---------23263
      104810/30/2017 ---------13162
      104910/31/201711/15/2017---------0--
      105010/31/2017 ---------03061

       

      I can then do a simple Count formula to see how many cases were open at the end of a given month (they may be closed in a future month, but at the end of that month they were still open):

      Cases Open at Months End
      JanFebMarAprMayJunJulAugSepOct
      333444441114

       

      And, I can do simple Average formula to see the Average Age of the Cases that were open at the end of a given month:

      Average Age of Cases Open at Months End
      JanFebMarAprMayJunJulAugSepOct
      26.331.0013.0026.2535.7547.0059.2590.2552.0950.50

       

      So, in the Matrix above, it is easy to see that there were 3 cases still open at the end of January, and they had been open for an average of 26.33 days.

       

      The thing I cannot seem to be able to do is duplicate this in Power BI.