Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have two columns: "Open Date/Time" and "Resolved Date/Time." They are both Date/Time data types
Not every item has a resolved date/time, but all of them have open date/time.
I need to calculation the total time in hours between "Open Date/Time" and "Resolved Date/Time."
I'm not able to get it to work using DATEDIFF
Solved! Go to Solution.
Minutes =
SWITCH (
TRUE (),
'Table'[start_date] < 'Table'[end_date], DATEDIFF ( 'Table'[start_date], 'Table'[end_date], MINUTE ),
'Table'[start_date] > 'Table'[end_date], DATEDIFF ( 'Table'[end_date], 'Table'[start_date], MINUTE ) * -1,
0
)This will take care of start times that are after end times which cause an error
Also as you can see blanks would not cause errors and how you hanlde those is up to you ![]()
Minutes =
SWITCH (
TRUE (),
'Table'[start_date] < 'Table'[end_date], DATEDIFF ( 'Table'[start_date], 'Table'[end_date], MINUTE ),
'Table'[start_date] > 'Table'[end_date], DATEDIFF ( 'Table'[end_date], 'Table'[start_date], MINUTE ) * -1,
0
)This will take care of start times that are after end times which cause an error
Also as you can see blanks would not cause errors and how you hanlde those is up to you ![]()
Are you getting a specific error message when creating the column/measure, or just not seeing the data you are expecting?
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 69 | |
| 45 | |
| 36 | |
| 28 | |
| 23 |
| User | Count |
|---|---|
| 142 | |
| 124 | |
| 59 | |
| 40 | |
| 32 |