Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AlfredR
Frequent Visitor

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.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

2 REPLIES 2
Anonymous
Not applicable

May be create a conditional column for closed Tickets and Open ticket based on Closed Date.

 So If closed date is not null them Ticket is closed and display 1 and name  this column as ClosedTicketCounts

Similar way If Closed Date is Null them display 1 and Rename this OpenTicketCounts.

v-chuncz-msft
Community Support
Community Support

@AlfredR 

 

You may refer to the following posts.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.