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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.