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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors