Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
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
Solved! Go to Solution.
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"
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!
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 19 | |
| 19 | |
| 17 | |
| 11 |
| User | Count |
|---|---|
| 59 | |
| 55 | |
| 42 | |
| 40 | |
| 30 |