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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Lenihan
Helper III
Helper III

Using Datediff but date and time data split

Hi, 

I had split my date/time columns for some calculated columns earlier, but, now, I've been asked to calculate difference between two dates, and for this I need both date and time. Is this possible to use datediff without having to rejoin these values back? I need to determine if a close date happens within 24 hours of the open date - so need to know both days and hours.  Is it possible in one formula to create a calculated column to determine the real # of hours between 4 columns?  (1. date and time fields when opened, and 2. date and time fields when closed)?

Thanks, 

Rob

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

I woulodn't have thought you'd have need to rejoin anything - the only time you need to be concerned about the time is if the start and end dates are precisely one day apart. Just go for a comparison like:

 

 

if (end date - start date) >=2 then "not within 24 hours", else

if (end date - start date) = 1 and (end time > start time) then "not within 24 hours" else "within 24 hours"

View solution in original post

2 REPLIES 2
jthomson
Solution Sage
Solution Sage

I woulodn't have thought you'd have need to rejoin anything - the only time you need to be concerned about the time is if the start and end dates are precisely one day apart. Just go for a comparison like:

 

 

if (end date - start date) >=2 then "not within 24 hours", else

if (end date - start date) = 1 and (end time > start time) then "not within 24 hours" else "within 24 hours"

That makes total sense.. I'll give that a try when I'm done meetings today and see if it comes out right.

Thanks!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.