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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Delguy87
Frequent Visitor

How to create a table to show number of days Trouble tickets take to clear

Hello, 

I have an Excel sheet of Trouble tickets with columns, 'Date Created' and 'Date Completed'.

Is there a way to generate a table to show the # of days it took to Complete the ticket. for example: 'Cleared in 7 days or less' Cleared in 8 to 30 days' 'Cleared in 31 to 60 days' and 'remaining open'.

 

I used the DATEDIFF([Date Created],[Date Completed],DAY), but was not able to get a table to show the example above.

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Delguy87 , You have to create a column for that like

 

New column =

var _diff = DATEDIFF([Date Created],[Date Completed],DAY)

return

Switch(True() ,

_diff <=7 , "   Cleared in 7 Days or less",

_diff <=30 , "  Cleared in 8 to 30 days",

_diff <=60 , " Cleared in 31 to 60 days",

"remaining open"

)

 

Give space in text to sort it properly

View solution in original post

v-tianyich-msft
Community Support
Community Support

Hi @Delguy87 ,

 

Awesome, @amitchandak  gave you a helpful answer, so you just need to tweak a few things based on his feedback:

vtianyichmsft_0-1709704932563.png

Measure = var _diff = DATEDIFF(MAX('Table'[Start]),MAX('Table'[End]),DAY)
return Switch(True() ,
_diff = BLANK() , "no completed",
_diff <=7 , "   Cleared in 7 Days or less",
_diff <=30 , "  Cleared in 8 to 30 days",
_diff <=60 , " Cleared in 31 to 60 days",
_diff > 60 , " over 60 days"
)

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Delguy87
Frequent Visitor

See below, I had to remove MAX to get it to work. However, How do i get tickets closed on the same day to be apart of "cleared in 7 days or less". Its showing as "remaining open". 

Basically seeing 0 and blank values as the same. 

see below:

SharedScreenshot111.jpg 

v-tianyich-msft
Community Support
Community Support

Hi @Delguy87 ,

 

Awesome, @amitchandak  gave you a helpful answer, so you just need to tweak a few things based on his feedback:

vtianyichmsft_0-1709704932563.png

Measure = var _diff = DATEDIFF(MAX('Table'[Start]),MAX('Table'[End]),DAY)
return Switch(True() ,
_diff = BLANK() , "no completed",
_diff <=7 , "   Cleared in 7 Days or less",
_diff <=30 , "  Cleared in 8 to 30 days",
_diff <=60 , " Cleared in 31 to 60 days",
_diff > 60 , " over 60 days"
)

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Delguy87 , You have to create a column for that like

 

New column =

var _diff = DATEDIFF([Date Created],[Date Completed],DAY)

return

Switch(True() ,

_diff <=7 , "   Cleared in 7 Days or less",

_diff <=30 , "  Cleared in 8 to 30 days",

_diff <=60 , " Cleared in 31 to 60 days",

"remaining open"

)

 

Give space in text to sort it properly

Thank you! I'm very close. the only issue I'm having now is that 'remaining open' results are filling in for tickets closed 60 days or more and tickets that are open with no completed dates. how would I set it up so that tickets will not show 'remaining open' for those two conditions? 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.