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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to get Hours between two date and time in measure and not in column

Need help to find out how i can get the hours between two dates (date format : 17-07-2018 16:13:25) . I need to calculate this by measure so that i am not including any new column. 

Thank you

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

I've created a sample as below:

Measure 4 = DATEDIFF(MAX('Table (3)'[Start Date]),MAX('Table (3)'[End date]),HOUR)

008.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

5 REPLIES 5
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

Any updates?

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Hi @Anonymous 

 

I've created a sample as below:

Measure 4 = DATEDIFF(MAX('Table (3)'[Start Date]),MAX('Table (3)'[End date]),HOUR)

008.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
PBFlash
Frequent Visitor

You can use the datediff function in DAX.

 

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

 

https://docs.microsoft.com/en-us/dax/datediff-function-dax

Anonymous
Not applicable

Datediff works fine for new column but its not working when i am trying to use a new measure using DAX  

Hi @Anonymous 

 

DATEDIFF should work in measure as well, please share your dummy data and i'd like to draw up it for you. 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors