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
Anonymous
Not applicable

Running Sum in Power BI for Ticket Backlog

I have IT Tickets data with below shown columns

  1. Ticket Number
  2. Ticket Status
  3. Ticket CreatedDate
  4. Ticket ResolvedDate

I would like to create a report like below...

 

MonthCreated CountResolved CountBacklogCalculation
   100<- Backlog
Jan-195040110<- 100+50-40
Feb-1910080130<- 110+100-80
Mar-19200100230 

 

I have the raw data and PBIX in one drive for you review.

 

https://1drv.ms/u/s!AuZ8zsEu-lf-aKZZdq9ll8lX0JA?e=Z93Vf4

 

Problem is I have done this in Tableau and QlikView in just a right click on mouse. But I have no clue on how to achieve these three metrics in a single table in Power BI. I have the similar requirement to show the same table by IT Team list instead of Month list etc.,

 

You help is greatly apreciated

1 ACCEPTED SOLUTION
carlomoretto
Frequent Visitor

Hi!

 

I think you could make a calendar table and establish relationships between the calendar table date and the creation and resolution dates. You can then use these relationships to compute the measures you need.

 

Here's what I've done.

 

Created a calendar table called DimDate using CALENDARAUTO()

Created relationships between the Date variable from the Calendar table and the Creation and Resolution Date.

 

I then created the 3 measures:

 

Created Count = CALCULATE(COUNT(data[ID]))

Resolved Count = CALCULATE(COUNT(data[ID]);USERELATIONSHIP(data[Resolution Date];DimDate[Date]);data[Resolution Date]<>BLANK())

Backlog = CALCULATE([Created Count]-[Resolved Count];FILTER(ALLSELECTED(DimDate);DimDate[Date]<=max(DimDate[Date])))

 

Created, Resolved, BacklogCreated, Resolved, Backlog

 

I hope this works for you!

View solution in original post

11 REPLIES 11
carlomoretto
Frequent Visitor

Hello @Anonymous !

 

Thanks for reaching out! I've tried to replicate your steps but haven't been able to replicate the issue. It works fine on my side. I'm attaching pbix and excel file:

 

https://wetransfer.com/downloads/311df5465449a6e1cb37fe060ba818d520201114103046/4666a444d634f3d3227b47b6f58d1d3b20201114103206/44e34e 

 

Let me know if this helps! Otherwise I'll be happy to review a demo of your data to see if I can help further!

 

Have a great weekend,

 

Carlo

Anonymous
Not applicable

Hi @carlomoretto ,

Many thanks for your reply and for taking the time to look at this. 

I've reviewed your file and I can confirm that it is indeed working as expected. I've also double-checked all measures and relationships with my file and everything seems to be ok, but I was still getting the volumes assigned to a blank date.

Then, i realized that i had another created and resolved column, with the same data in it. I changed the relationship to those columns and the measures and voilá, it worked. 

Thanks a lot for your help! 

Anonymous
Not applicable

Hi @carlomoretto , community,

 

I have a very similar issue than this one that i've tried to resolve without the desired outcome. 

 

My scenario is very similar to this one. I have a volume of incidents created in a specific date and the resolution date for each incident. 

I've created the calendar and relationships above and they seem to be fine:
1.jpg3.jpg

 

I've also ensured that the calendar, created and resolved date have the same format and created the 3 measures as per below:

 

*Created Count = CALCULATE(COUNT(Issues[Issue ID]))
*Resolved Count = CALCULATE(COUNT(Issues[Issue ID]),USERELATIONSHIP(Issues[Resolved], 'Calendar'[Date]),Issues[Resolved] <> BLANK())
*Backlog = CALCULATE([*Created Count]-[*Resolved Count], FILTER(ALLSELECTED('Calendar'), 'Calendar'[Date] <=MAX('Calendar'[Date])))
 
But when i create the table/matrix, it puts the values on a blank date, not under the correct date that should be October and November 2020:
 
 

2.jpg3.jpg

 

 

Can someone help me with this topic? What am i doing wrong?

Thanks!

carlomoretto
Frequent Visitor

Hi!

 

I think you could make a calendar table and establish relationships between the calendar table date and the creation and resolution dates. You can then use these relationships to compute the measures you need.

 

Here's what I've done.

 

Created a calendar table called DimDate using CALENDARAUTO()

Created relationships between the Date variable from the Calendar table and the Creation and Resolution Date.

 

I then created the 3 measures:

 

Created Count = CALCULATE(COUNT(data[ID]))

Resolved Count = CALCULATE(COUNT(data[ID]);USERELATIONSHIP(data[Resolution Date];DimDate[Date]);data[Resolution Date]<>BLANK())

Backlog = CALCULATE([Created Count]-[Resolved Count];FILTER(ALLSELECTED(DimDate);DimDate[Date]<=max(DimDate[Date])))

 

Created, Resolved, BacklogCreated, Resolved, Backlog

 

I hope this works for you!

Thanks, this is great!

Anonymous
Not applicable

Capture2.PNG

 

Thanks for replying. I tried the steps but not able to replicate the same chart as you did..

 

Can you help me with your PBIX..?

 

I can also see Creation Date and Resolution Date columns in your screenshot.. But I dont have those.. AM i facing the issue because of this..?

 

I created relationship like DimDate Date = Date Created (Many to Many and Single)... I did anything wrong?

 

 

Hi! 

 

Once you have the time table, you just have to create the relationship between the Date of the time table and the creation date and resolution date. Just make sure all dates are in the same format (I've set them to dd/MM/yyyy). Since you're interested in the date without hours and minutes, you can also extract them in a new column, like so:

 

Creation Date = data[Created].[Date]

Resolution Date = data[Resolved].[Date]

 

You then establish the relationships as shown in the screen below:

First you drag and drop the Date field from the DimDate table to the Creation Date field. This creates an active 1 to Many relationship between the Date and the Creation Date.

 

Then you drag and drop the Date field from the DimDate table to the Resolution Date field. This creates an inactive 1 to Many relationship between the Date and the Resolution Date. This is the relationship that we activate when using the USERELATIONSHIP function in the measure for the Resolved Count.

 

Relationships between ddatesRelationships between ddates

Then your results will certainly be correct!

 

Anonymous
Not applicable

Thanks a lot. Now i followed the instructions and able to replicate the same visual..

 

All  calculation seems to be fine except for January (Backlog 224 + Created 6644 - Resolved 5639) so Jan backlog is 1229. It is showing 781.

 

Also if I have a Support Team column (L1 Support, L2 Support) in the data. And if I need a visual like below.. Is it possible?

 

 JanuaryFeb
Support GroupOpened CountResolved CountBacklogOpened CountResolved CountBacklog
L1 Support10050501005050
L2 Support1232310012323100

Sorry, my mistake, I forgot to exclude the blank dates from the Resolved Count measure:

 

Resolved Count = CALCULATE(COUNT(data[ID]);USERELATIONSHIP(data[Resolution Date];DimDate[Date]);data[Resolution Date]<>BLANK())
 
That should do
 
You can get the table you're looking for by simply creating a Matrix visual, where you will put the Date on the Columns, the Groups on the rows and the three measures on the values.
 
 
Anonymous
Not applicable

@carlomoretto  My friend the solution is working perfectly. One more help.

 

In our solution we were using the data fields as DATE ONLY. If I change it to DateTime then the results are not coming up. Is there any ways to use the date fields as DateTime with the same solution?

 

Reason is I have to bring a count like below...

                   Opened      Closed    Backlog (Carry to next shift)

Shift 1        100              20              80

Shift 2         80+50       60              70

Shift 3         70+10       10              70

 

Where Shift 1 is 6 am to 2 pm, Shift 2 is 2pm to 10 PM and Shift 3 is 10 PM to 6 AM

80+50 and 70+10 means - 80 came from Shift 1 and 50 new tickets got created in shift 2.

 

You idea will help me a lot....

 

Anonymous
Not applicable

Thank you so much.. YOU are awesome....

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.