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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
MBWATSON
Helper II
Helper II

Finding a difference between 2 columns

Good morning,

 

I have a table with a column titled Status Audit Type. Two of the values in this column are Create and Done and each has a corresponding date/time in another column Titled Status Changed At.

MBWATSON_0-1681229470720.png

I am needing to find the turn around time from when a message was created and when it was completed (done).

Any suggestions?

Thank you!

Melissa

 

7 REPLIES 7
amitchandak
Super User
Super User

@MBWATSON ,

a measure

 

sumx( Values(Table[message ID]), calculate(datediff(minx(filter(Table, Table[Status Audit Type] ="Create"), Table[Status Changed at]), maxx(filter(Table, Table[Status Audit Type] ="Done"), Table[Status Changed at]), hour)))

 

For column consider earlier

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you amitchandak. Should the result come out in hours then? Minutes? A numerical value for date/time?

 

@MBWATSON , datediff you can get in hour, minute, second , day

 

if you need get time, simply date diff two, but that will not sum

 

You can try like

 

time(0,0,0) + sumx( Values(Table[message ID]), calculate(datediff(minx(filter(Table, Table[Status Audit Type] ="Create"), Table[Status Changed at]), maxx(filter(Table, Table[Status Audit Type] ="Done"), Table[Status Changed at]), hour)))/24

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Throwing this back out there 🙂

The suggested formula for the measure did not work. Here is an example

MBWATSON_0-1681508426717.png

This particular message took almost a year to complete. Yet here is the cycle time using the formula shown in hh:mm format

MBWATSON_1-1681508496007.png

Any other suggestions @amitchandak or anyone else?

 

Maybe I should clarify, I am looking for the amount of time it took to complete the work, from the create time to the done time.  When I try the second formula I get an error message.

I found the error so that isn't an issue. The formula returns a date and time. What I need is for it to return HH:MM

@amitchandak I was able to get this to show a time but they aren't correct. I have a Create date/time of 4/19/2022 8:20:09 and a Done date/time of 10/31/22 6:17:17 that doesn't even show in the Matrix. Some with similar dates/times showing in the Matrix as 7 hours. Any other suggestions? 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.