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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

calculate the open and closed tickets and response taken by each user from open to close

I have the data from API that cotains these columns .

id,OpenDate,Employee,Status,Close date.

These are the things which i need to find out from this.

  1. Calculate the last 30 days requests
  2. Calculate the last 30 days closed request
  3. Calculate the Average response time to close each request
  4. Calculate the open and close request per day
  5. Calculate the avergae response time by emoloyee to close the request. 

Please find the sample data for the same. Could you please let me know how to calculate these open  and closed tickets based on the uniqueid and other details provided below.

 

i have already looked into different groups of power bi and was not able to find the exact solution for this issue. if you see the data below the id is unique for open and closed. 

i am trying to create a report similar to a devops thing. 

 

IdGroupTypeOpenDateEmployeeUpdateDateStatusClosedDateQuarterMonthDayYearOpenedYearClosedMonthOpenedMonthClosedMonthNumberCreatedDates
5d64fec8-7ac4-4393-8893-08d7d4ad4421Req 30thType 30th3/30/2020 13:34Test 1 open Q1March302020 3 33/30/2020 13:34
e802fd3b-5dc3-4bc0-b6cb-08d7d4c6734fReq 30thType 30th3/30/2020 16:22Test 2 open Q1March302020 3 33/30/2020 16:22
6ce82225-55ff-4258-b6d2-08d7d4c6734fReq 30thType 30th3/30/2020 16:50Test 3 open Q1March302020 3 33/30/2020 16:50
4a46eef0-118b-4509-03d3-08d7d5347b8cRequest 31st groupRequest 31st Type3/31/2020 5:29Test 3 open Q1March312020 3 33/31/2020 5:29
c90b2fa8-a30f-462c-03d4-08d7d5347b8cRequest 31st groupRequest 31st Type3/31/2020 5:29Test 4 open Q1March312020 3 33/31/2020 5:29
8cbb050b-567e-4663-d6ae-08d7e1022950Testing hireHire new4/15/2020 5:59Test 5 open Q2April152020 4 44/15/2020 5:59
b827cd4e-ce02-4d8f-97f2-08d7e210453dReq-16aReq test 164/16/2020 14:23Test 4 open Q2April162020 4 44/16/2020 14:23
5c6ba1f4-bc0d-412b-755b-08d7e2b1758dnew group for hire & new positionfor hire4/17/2020 12:22Test 6 open Q2April172020 4 44/17/2020 12:22
d860fdd1-3043-47bc-755f-08d7e2b1758dnew group for hire & new positionwithout temp 24/17/2020 12:26Test 7 open Q2April172020 4 44/17/2020 12:26
b1bc90ad-beee-4227-f75b-08d7d230df8eBasicBasic3/27/2020 9:26Test 83/27/2020 9:26closed3/27/2020 9:26Q1March27202020203333/27/2020 9:26
ca44903c-25f5-4e88-f9ef-08d7d2352158Request Group 27thRequest Type 23/27/2020 10:08Test 33/27/2020 10:08closed3/27/2020 10:08Q1March27202020203333/27/2020 10:08
ddc014f2-14fb-4e66-040a-08d7d23a0016Request Group 27thRequest Type 23/27/2020 10:31Test 33/27/2020 10:31closed3/27/2020 10:31Q1March27202020203333/27/2020 10:31
69b08ca2-d68d-4eaf-040c-08d7d23a0016BasicBasic3/27/2020 10:43Test 33/27/2020 10:43closed3/27/2020 10:43Q1March27202020203333/27/2020 10:43
0a2fac88-c23b-4dc3-040d-08d7d23a0016BasicBasic3/27/2020 10:45Test 33/27/2020 10:45closed3/27/2020 10:45Q1March27202020203333/27/2020 10:45
d569ad52-bb09-46af-f8db-08d7d23fadd6Request Group 27thRequest Type 23/27/2020 11:12Test 33/27/2020 11:12closed3/27/2020 11:12Q1March27202020203333/27/2020 11:12
434ffe90-b6e7-4f0f-f8dc-08d7d23fadd6Request Group 27thRequest Type 23/27/2020 11:42Test 33/27/2020 11:42closed3/27/2020 11:42Q1March27202020203333/27/2020 11:42
d8a063fc-8cae-420d-18bb-08d7d2cad09eReq 28R 283/28/2020 6:10Test 33/28/2020 6:10closed3/28/2020 6:10Q1March28202020203333/28/2020 6:10
881c9834-a3ab-455b-8872-08d7d4ad4421Testing hireHire new3/30/2020 13:31Test 33/30/2020 13:31closed3/30/2020 13:31Q1March30202020203333/30/2020 13:31

 

 

Thank you in advance.

 

@PBICommunity 

 

2 ACCEPTED SOLUTIONS

@Anonymous , Seem fine. If working for you.

View solution in original post

Anonymous
Not applicable

I got the Solution. 

 

image.png

 

 

 

 

 

 

 

 

 

Running balance which will give the count of balance each row.

 

Running Balance =
CALCULATE(
[Balanceoftickets],
FILTER(
ALLSELECTED('R_Requests1'),
'R_Requests1'[CreatedDate] <= max('R_Requests1'[CreatedDate])
)
)
 
Balanceoftickets = [Created Tickets] - [ Resolved Tickets]
 
Created Tickets = CALCULATE([Tickets], USERELATIONSHIP('Dates1'[Date], R_Requests1[CreatedDate]))
 
 Resolved Tickets =
CALCULATE([Tickets],
USERELATIONSHIP('Dates1'[Date], R_Requests1[ClosedDate]),
NOT(ISBLANK(R_Requests1[ClosedDate])
))
 
Tickets = COUNTROWS(VALUES(R_Requests1[Id]))
 
 
 
 
 

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User
Anonymous
Not applicable

@amitchandak 

Do you mean i need to change this dax queries in this way for open tickets, close tickets.

 

Open tickets = CALCULATE(COUNT(tickets[Id ]),USERELATIONSHIP(tickets[Start Date],'Date'[Date]) )

closed tickets = CALCULATE(COUNT(tickets[Id ]),USERELATIONSHIP(tickets[End Date],'Date'[Date]),not(ISBLANK(tickets[End Date])))

running tickets = CALCULATE(COUNTx(FILTER(tickets,tickets[Start Date]<=max('Date'[Date]) && (ISBLANK(tickets[End Date]) || tickets[End Date]>max('Date'[Date]))),(tickets[Id ])),CROSSFILTER(tickets[Start Date],'Date'[Date],None))

Last ticket completed = 
var _min_date = minx(all('Date'),'Date'[Date])
var _Expression=if(ISFILTERED('Date'[Month Year]),maxx('Date',DATEADD('Date'[Date],-1,MONTH)),maxx('Date',DATEADD('Date'[Date],-1,YEAR)))
Return
 CALCULATE(COUNTx(FILTER(tickets,tickets[Start Date]<=_Expression && tickets[Start Date]>=_min_date && (ISBLANK(tickets[End Date]) || tickets[End Date]>_Expression)),(tickets[Id ])),CROSSFILTER(tickets[Start Date],'Date'[Date],None))

ticket Change% = if(not(ISBLANK([Last ticket completed])),CALCULATE( (divide([Current tickets],[Last ticket completed]) -1)*100))

 

 

@Anonymous , Seem fine. If working for you.

Anonymous
Not applicable

Hi @amitchandak  

i have tried the below measure to calculate the last day currenttickets + presentday current tickets in this way. it is not giving me any data 

Lastticketmp =
IF(ISFILTERED('Dates1'[Month Year]), CALCULATE([Currentticketsmp], DATEADD('Dates1'[Date],-1,MONTH)), CALCULATE([Currentticketsmp], DATEADD('Dates1'[Date],-1,YEAR)))
 
Currentticketsmp = CALCULATE(COUNTx(FILTER(R_Requests1,R_Requests1[CreatedDate] <= max('Dates1'[Date]) && (ISBLANK(R_Requests1[ClosedDate] ) || R_Requests1[ClosedDate] >max('Dates1'[Date]))),(R_Requests1[Id])),CROSSFILTER(R_Requests1[CreatedDate] ,'Dates1'[Date],None))
 
i have tried this measure also to calculate the same. but it is not giving me any data actually.
 
Last Period Employee = 
var _min_date = minx(all('Date'),'Date'[Date])
var _Expression=if(ISFILTERED('Date'[Month Year]),maxx('Date',ENDOFMONTH(DATEADD('Date'[Date],-1,MONTH))),maxx('Date',DATEADD('Date'[Date],-1,YEAR)))
Return
 CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=_Expression && Employee[Start Date]>=_min_date && (ISBLANK(Employee[End Date]) || Employee[End Date]>_Expression)),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))

 

while i am validating _expression i got this data Year Quarter Month Day in this way. could you please let me know if i am not entering any format or expression correctly. Please look into it.

Year Quarter Month Day
1900 Qtr 1 January 1
1900 Qtr 1 January 2
1900 Qtr 1 January 3
1900 Qtr 1 January 4

@PBICommunity 

Anonymous
Not applicable

I got the Solution. 

 

image.png

 

 

 

 

 

 

 

 

 

Running balance which will give the count of balance each row.

 

Running Balance =
CALCULATE(
[Balanceoftickets],
FILTER(
ALLSELECTED('R_Requests1'),
'R_Requests1'[CreatedDate] <= max('R_Requests1'[CreatedDate])
)
)
 
Balanceoftickets = [Created Tickets] - [ Resolved Tickets]
 
Created Tickets = CALCULATE([Tickets], USERELATIONSHIP('Dates1'[Date], R_Requests1[CreatedDate]))
 
 Resolved Tickets =
CALCULATE([Tickets],
USERELATIONSHIP('Dates1'[Date], R_Requests1[ClosedDate]),
NOT(ISBLANK(R_Requests1[ClosedDate])
))
 
Tickets = COUNTROWS(VALUES(R_Requests1[Id]))
 
 
 
 
 
Anonymous
Not applicable

Hi @amitchandak 

Thanks for the help. yes it worked well for me but i miss some of them in the report. could you please let me know how to achieve this items .

Current tickets  = previous day requests + Next days Open Request (excluding the closed ones)

 

Last 7 days open and closed requests and 30 days open and closed requests. As you can see in below on March 27th there were 17 open and 9 closed and 8 were on going on the next day the addition of 13+8 in the ongoing.

image.png

 

 

 

 

 

Thanks in advance .

Greg_Deckler
Super User
Super User

I believe this will assist. https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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