Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.