cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User IV
Super User IV

Re: Calculate hours between two date/time column

Hi,

Mine is a calculated column formula - not a measure.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Advocate II
Advocate II

Re: Calculate hours between two date/time column

Hi @Ashish_Mathur 

 

i have also created calculated column

 

Highlighted
Advocate II
Advocate II

Re: Calculate hours between two date/time column

Datediff = DATEDIFF(Table[start date time final],Table[End date time final],Hours)
Highlighted
Super User IV
Super User IV

Re: Calculate hours between two date/time column

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Highlighted
Super User II
Super User II

Re: Calculate hours between two date/time column

@sathyaramesh are your columns really dates and times? They must be for this to work. They cannot be text that looks like it. That might be why you are getting zero. Check out this CONVERT() function in DAX and see if that helps. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Highlighted
Advocate II
Advocate II

Re: Calculate hours between two date/time column

Hi @edhans 

The column is of date/time column.type1.PNG

Highlighted
Super User IV
Super User IV

Re: Calculate hours between two date/time column

datediff =datediff(startate,enddate, HOUR)

 

Not hours, make sure that is correct.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Super User IV
Super User IV

Re: Calculate hours between two date/time column

Yep, works

 

image.png


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Advocate II
Advocate II

Re: Calculate hours between two date/time column

Hi @Greg_Deckler @edhans @Ashish_Mathur 

 

Sorry for my mistake. I made some mistake in calculated column.(I used both date as (start date time) for finding difference).

i think its working fine. Thank you so much for all your replay

Highlighted
Super User IV
Super User IV

Re: Calculate hours between two date/time column

No, my apologies @sathyaramesh, that one is all on me, I actually originally posted ,HOURS and moved on and it bugged me whether the syntax was actually HOUR or HOURS but I didn't check, I figured DAX intellitext would save you if I got it wrong. My bad.

---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Top Solution Authors
Top Kudoed Authors