cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Using DATEDIFF to calculate (hh:mm)

I am trying to find the difference in time down to the hour and minute. Here is an example of some of the data.

 

cmiller1221_1-1594760841952.png

 

 

I cant seem to write a DAX statement that allows me to output the hours and minutes elapsed between the two columns. One problem I am running into with the HOUR feature is that it maxes at 23 hours. Any help would be appreciated. 

 

2 REPLIES 2
Highlighted
Super User VI
Super User VI

Re: Using DATEDIFF to calculate (hh:mm)

Hi @cmiller1221 

try smth like

Column = 
var diff = VALUE([ResolvedDate] - [DiscoveredDate])
var h = ROUNDDOWN(24 * diff, 0)
var m = ROUNDDOWN(60* (24 * diff - h), 0)
RETURN
h & "h " & m & "m"

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Highlighted
Super User IX
Super User IX

Re: Using DATEDIFF to calculate (hh:mm)

@cmiller1221 , you date diff between

Date1 - Date2 = it will be in time, more than 24 hours will in day

 

if you try datediff(Date1,Date2,Minute), You need convert into hours and minute using Mod and quotient and display as text

 

https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi...

https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors