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

Duration between two tickets statuses

I have a change log record containing (3) columns:

"TicketNumber", "ChangedWhen", "Status"

 

Each "TicketNumber" will appear in multiple records. 

Each record can have 1 of 6 "Status" and a date and time that the "Status" changed.  

The 6 statuses are not used in constant succession so the ticket may trasition from and back to statuses as seen in the example below.  

Example.PNG

 

We are trying to calculate the duration in minutes between the first InProcess "ChangedWhen" record and the last Committed "ChangedWhen" record for each "TicketNumber".     

 

Any suggestions? 

 

    

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

hi, @Anonymous 

You could use DATEDIFF Function to create a measure

Measure = var _firstInProcess =CALCULATE(MIN('Table'[ChangedWhen]),'Table'[Status]="In Process") 
var _lastCommitted=CALCULATE(MAX('Table'[ChangedWhen]),'Table'[Status]="Committed") 
return
DATEDIFF(_firstInProcess,_lastCommitted,MINUTE)

Then drag TicketNumber and the measure into a table visual.

 

Best Regards,

Lin

 

 

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You could use DATEDIFF Function to create a measure

Measure = var _firstInProcess =CALCULATE(MIN('Table'[ChangedWhen]),'Table'[Status]="In Process") 
var _lastCommitted=CALCULATE(MAX('Table'[ChangedWhen]),'Table'[Status]="Committed") 
return
DATEDIFF(_firstInProcess,_lastCommitted,MINUTE)

Then drag TicketNumber and the measure into a table visual.

 

Best Regards,

Lin

 

 

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

Hey,

 

please provide an Excel file with some  sample data, upload the file to onedrive or dropbox and share the link.

 

I wonder if each ticket has also a "committed state"?

What is your expected result if there is no "Committed" state?

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.