Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Rolling 12 month total

I have some data which shows the date a plan was issued and whether it was issued on time or late (data below) - at the moment the data has plans issued back to Jan 2018 but this may be extended later

 

I have graphs which show the numbers and percentages that were issued on time each month, but I need to also be able to show the rolling 12 month total - I've serached but can't find a solution that I can get to work (I am a novice power BI user so am struggling a little to retro-fit some of the suggestions)

 

Ideally I would like to be able to show a variety of graphs inlcuding secondary axis (see picture for a selection of graphs pulled together in excel), but also have a date slicer so that users can pick their own period to view

 

I have a large calendar table available with various date calculations with index dates going from 01/01/1950 through to 31/12/2050

 

Any help gratefully received

Thanks 🙂

 

 

 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Here is the sample data

     

    Completed DateIDOn Time?
    02/01/201874199Issued Late
    02/01/2018135527Issued Late
    02/01/2018171669Issued Late
    03/01/201861538Issued Late
    03/01/2018108135Issued Late
    03/01/2018108659Issued on Time
    03/01/2018176304Issued Late
    03/01/2018186854Issued Late
    08/01/2018137803Issued Late
    09/01/2018131307Issued Late
    09/01/2018149297Issued Late
    09/01/2018172292Issued Late
    09/01/2018175415Issued Late
    10/01/201856709Issued Late
    10/01/2018107016Issued Late
    10/01/2018113320Issued Late
    12/01/201880528Issued Late
    12/01/2018129652Issued Late
    15/01/2018168704Issued Late
    17/01/2018170877Issued Late
    18/01/2018135823Issued on Time
    18/01/2018189684Issued Late
    22/01/2018169977Issued Late
    24/01/2018117956Issued Late
    25/01/201885218Issued Late
    28/01/2018173800Issued on Time
    29/01/2018118641Issued Late
    29/01/2018118642Issued Late
    29/01/2018163250Issued on Time
    30/01/2018139510Issued Late
    30/01/2018150284Issued Late
    31/01/2018105258Issued Late
    31/01/2018117433Issued Late
    05/02/2018146625Issued on Time
    05/02/2018160985Issued Late
    06/02/201888403Issued Late
    06/02/2018113419Issued Late
    06/02/2018137660Issued Late
    06/02/2018175074Issued Late
    06/02/2018185855Issued Late
    06/02/2018191901Issued Late
    07/02/2018118395Issued on Time
    07/02/2018159842Issued Late
    07/02/2018169744Issued Late
    09/02/2018124823Issued Late
    12/02/2018118757Issued Late
    12/02/2018160193Issued Late
    12/02/2018162288Issued on Time
    12/02/2018186487Issued Late
    13/02/2018151749Issued on Time
    13/02/2018173399Issued Late
    13/02/2018173919Issued Late
    14/02/2018151319Issued on Time
    15/02/2018145754Issued on Time
    15/02/2018150684Issued Late
    15/02/2018176530Issued Late
    21/02/2018118495Issued Late
    22/02/2018157091Issued Late
    22/02/2018192944Issued Late
    26/02/2018150545Issued Late
    26/02/2018161906Issued Late
    26/02/2018180552Issued Late
    28/02/2018108907Issued Late
    28/02/2018191903Issued Late
    05/03/201877259Issued on Time
    05/03/2018109262Issued Late
    05/03/2018126208Issued Late
    05/03/2018170580Issued Late
    06/03/2018155220Issued Late
    06/03/2018179782Issued Late
    07/03/201813451Issued Late
    08/03/2018148851Issued on Time
    09/03/2018151751Issued Late
    09/03/2018177687Issued on Time
    09/03/2018179979Issued Late
    12/03/201897334Issued Late
    12/03/2018117174Issued on Time
    12/03/2018130213Issued Late
    13/03/201884406Issued Late
    13/03/2018131073Issued on Time
    13/03/2018196434Issued Late
    14/03/2018175440Issued on Time
    15/03/201870967Issued Late
    19/03/2018172801Issued Late
    20/03/201885739Issued Late
    22/03/201893943Issued on Time
    22/03/2018175961Issued Late
    26/03/201885646Issued Late
    26/03/2018161540Issued Late
    26/03/2018168472Issued Late
    27/03/201883412Issued Late
    27/03/2018122662Issued Late
    29/03/2018114942Issued Late
    29/03/2018184929Issued Late
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can create the measures as below:

    Issued on Time = CALCULATE(DISTINCTCOUNT('Table'[ID]),'Table'[On Time?]="Issued on Time")
    Issued on Time(R12) = CALCULATE([Issued on Time], DATESBETWEEN (
            'Calendar'[Date],
            NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[Date] ) ) ),
            LASTDATE ( 'Calendar'[Date] )
        ) )
    Issued Late = CALCULATE(DISTINCTCOUNT('Table'[ID]),'Table'[On Time?]="Issued Late")
    Issued Late(R12) = CALCULATE([Issued Late],DATESBETWEEN (
            'Calendar'[Date],
            NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[Date] ) ) ),
            LASTDATE ( 'Calendar'[Date] )
        ) )
    Issue on Time % = DIVIDE( [Issued on Time],([Issued on Time]+[Issued Late]))
    Issue on Time(R12) % = DIVIDE( [Issued on Time(R12)],([Issued on Time(R12)]+[Issued Late(R12)]))

    I just created a sample pbix file, you can get it from this link.

    Best Regards

    Rena

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Rena

       

      That is really helpful for the most part - couple of issues which don't quite seem to be working right which I can't quite work out how to fix...

       

      In your example, it is picking up data from 2017 even though the data set only goes back to Jan 2018.

       

      In my version of it, it is not doing that for most graphs but it is for the comb-graph for issued on time in month and over a rolling 12 it is pulling in all the dates in my date calendar, even when a specific date is selected - all of the other graphs are filtering fine - any ideas?

       

      Thanks 🙂

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        Sorry for replying late. Could you please give me an example to tell which calculated values are incorrect and what should be the correct values? Also, where does the date field applied on slicer come from? If it is convenient, could you please provide your pbix file directly in order to make troubleshooting based on your actual scenario?

        Best Regards

        Rena