Forum Discussion

asah's avatar
asah
Helper I
6 years ago
Solved

Help needed with Recursive / Iterative Calculation

Hi,

I am requesting for some help in achieving the following outcome in Power BI which requires a recursive calculation. The source data has the following columns:

 

Date Ticket Created - The date when the ticket was created

Date Ticket Solved - The date when the ticket was set to a solved state

Ticket ID - Unique ID of the ticket

Ticket Priority - Priority assigned to the ticket

Ticket Status - New / Open / Solved / Closed

SLA Status - Achieved / Active / Breached (Fulfilled) / Breached (Active)

Ticket Type - Incident / Problem / Task / Question

WeekTicketCreate - Week Number generated from a custom lookup table referencing the date when the ticket was created

WeekTicket Solve - Week Number generated from a custom lookup table referencing the date when the ticket was solved

Open@EOW (End of Week) - Custom column comparing if WeekTicketSolve > WeekTicketCreate and assign a 1 or 0 accordingly

IsSLABreach - Custom Column to assign True if SLA Status is Breached (Fulfilled) or Breached (Active) and False if Achieved

IsOpen - Custom Column to assign True  if Ticket Status is New or Open and False if Solved or Closed

Since the source data contains historical information as well, tickets in the past may well be reflecting in a solved / closed status but I am keen to see at a given day, how many tickets raised previously or on the same day were open and out of SLA.

 

Requirement - For each date in the table, I am looking at generating a cumulative count of open tickets (Incident & Problems) where IsSLABreach = True for the previous or same dates.

 

Date (Ticket Created)Date (Ticket Solved)Ticket IdTicket PriorityTicket StatusSLA Metric StatusTicket TypeWeekTicketCreateWeekTicketSolveOpen@EOWPeriodYearIsSLABreachIsOpen
30-Jan-2003-Feb-2011115088P3SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
04-Feb-20 11115089P3OpenActiveIncident50 0P122019-20FALSETRUE
04-Feb-20 11115090P3OpenActiveIncident50 0P122019-20FALSETRUE
29-Jan-2030-Jan-2011115091P4SolvedBreached (Fulfilled)Incident49490P122019-20TRUEFALSE
30-Jan-2003-Feb-2011115092P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
30-Jan-2003-Feb-2011115093P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
31-Jan-2003-Feb-2011115094P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
31-Jan-2031-Jan-2011115095P4SolvedAchievedIncident49490P122019-20FALSEFALSE
31-Jan-2003-Feb-2011115096P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
31-Jan-2004-Feb-2011115097P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
01-Feb-2005-Feb-2011115098P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
02-Feb-20 11115099P4OpenBreached (Active)Incident49 1P122019-20TRUETRUE
02-Feb-2004-Feb-2011115100P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
02-Feb-2004-Feb-2011115101P4SolvedBreached (Fulfilled)Incident49501P122019-20TRUEFALSE
03-Feb-2004-Feb-2011115102P4SolvedAchievedIncident50500P122019-20FALSEFALSE
03-Feb-2004-Feb-2011115103P4SolvedBreached (Fulfilled)Incident50500P122019-20TRUEFALSE
04-Feb-2005-Feb-2011115104P4SolvedBreached (Fulfilled)Incident50500P122019-20TRUEFALSE
04-Feb-2005-Feb-2011115105P4SolvedBreached (Fulfilled)Incident50500P122019-20TRUEFALSE
04-Feb-20 11115106P4NewActiveIncident50 0P122019-20FALSETRUE
04-Feb-2004-Feb-2011115107P2SolvedAchievedIncident50500P122019-20FALSEFALSE
04-Feb-2005-Feb-2011115108P3SolvedBreached (Fulfilled)Task50500P122019-20TRUEFALSE
04-Feb-2004-Feb-2011115109P3SolvedAchievedTask50500P122019-20FALSEFALSE
04-Feb-2004-Feb-2011115110P3SolvedAchievedTask50500P122019-20FALSEFALSE
04-Feb-2004-Feb-2011115111P3SolvedAchievedTask50500P122019-20FALSEFALSE
04-Feb-2004-Feb-2011115112P3SolvedAchievedTask50500P122019-20FALSEFALSE
04-Feb-2004-Feb-2011115113P3SolvedAchievedTask50500P122019-20FALSEFALSE
04-Feb-2005-Feb-2011115114P3SolvedAchievedTask50500P122019-20FALSEFALSE
03-Feb-20 11115115P3OpenBreached (Active)Incident50 1P122019-20TRUETRUE

9 Replies

  • Hi asah ,

     

    Perhaps the following measure: 

    OpenTicketCount = Calculate(Distinctcount([Ticket Id]), [IsBreached] = "True")

     

    And if you slice that by date in a table visual for example, it should give you the desired result. That's if I've fully understood your requirement of course.

    • ImkeF's avatar
      ImkeF
      Community Champion

      Hi asah  

      not sure about your requirement here. With regards to the first row: Do you want to count this item as open at the date of 31. January of example? So basically create a history of open/closed status?

      • asah's avatar
        asah
        Helper I

        Hi ImkeF 

        Thanks for looking into this. Apologies, I noticed that I did not sort the sample data before uploading. It should be sorted first on the created date and then the ticket id. Regardless of that, this is what I am trying to achieve in a column:

        1) Considering that ticket created on 30-Jan is the first ticket in the source data, the backlog of open tickets out of SLA will be 0

        2) 2nd row suggests that a ticket has been created on 4-Feb, however the previous ticket has been closed on 3-Feb, so the backlog of open tickets out of SLA remain 0.

        3) Again, there is another ticket opened on 4-Feb and the previous ticket still remains open and IsSLABreach = False, so the backlog still remains 0. However, if the IsSLABreach had been True, the value would have been 1.

        So on and so forth. Please let me know if I am making sense or I will try and explain differently. Any help is greatly appreciated.

        Cheers,

        Anirudh