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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
cmiller1221
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
amitchandak
Super User
Super User

@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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
az38
Community Champion
Community Champion

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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