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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
roninn75
New Member

Calculate difference between two date/time values

Hi, please assist with the following:

BI-TIME_diff.png

 

i want to subtract time in [2] from [1]. the result wont be a date obviously.

any assistance would be appreciated.

2 REPLIES 2
PauloH
Frequent Visitor

Hi @roninn75,

 

You can also use:

 

Calculates the fraction of the year represented by the number of whole days between two dates. Use the YEARFRAC worksheet function to identify the proportion of a whole year's benefits or obligations to assign to a specific term.

YEARFRAC(<start_date>, <end_date>, <basis>)

 

https://msdn.microsoft.com/en-us/library/ee634405.aspx 

Zubair_Muhammad
Community Champion
Community Champion

Hi @roninn75

 

Try the DATEDIFF formula

 

https://msdn.microsoft.com/en-us/library/dn802538.aspx

 

DATEDIFF(<start_date>, <end_date>, <interval>)  

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.