Forum Discussion

AlfredR's avatar
AlfredR
Frequent Visitor
7 years ago
Solved

Cumulative difference between count of two dates

I have something that I haven't been able to solve trying to get information from a ticketing system. I have a table with two date fields, opendate and close date.
I have made two measures to calculate the count of dates for each field so that I can know based on that count, in a period of time how many tickets where opened and how many where closed. Here is an example of the data:

OpenDate

CloseDate

10/07/2019

11/07/2019

10/07/2019

 

11/07/2019

11/07/2019

11/07/2019

12/07/2019

13/07/2019

12/07/2019

13/07/2019

13/07/2019

13/07/2019

19/07/2019

14/07/2019

13/07/2019

14/07/2019

13/07/2019

14/07/2019

14/07/2019

15/07/2019

14/07/2019

15/07/2019

 

15/07/2019

15/07/2019

15/07/2019

15/07/2019

16/07/2019

15/07/2019

16/07/2019

15/07/2019

16/07/2019

16/07/2019

16/07/2019

 

17/07/2019

17/07/2019

17/07/2019

17/07/2019

18/07/2019

17/07/2019

19/07/2019

18/07/2019

19/07/2019

 

19/07/2019

 

19/07/2019

19/07/2019


My measures are:

Tickets Opended = COUNTX(tickets,tickets[OpenDate])
Tickets Closed = COUNTX(tickets,tickets[CloseDate])

I calculate by date the tickets not solved in a period by substracting those two measutres. Now what I'm trying to acomplish now is keep track of the sum of difference of those counts over time. Let's say that on day one I had one ticket not closed, and day two I had another ticket not closed, the pending tickets should be two, not one. And if on day three I have 5 tickets opened and 3 closed that two not closed should sum with the two remaining from other periods so I have 4 tickets pending. If on a fourth day I have 3 tickets opened and 4 closed then the total pending should be 3 because I closed an older ticket.

I haven't been able to figure out how to do that. I'm visualizing this data in a column graph where the values are those measures and the axis is the date of the ticket creation.

Any help would be appreciated.

2 Replies