cancel
Showing results for
Did you mean:
Highlighted
Super User V

## 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
Highlighted

## Re: Calculate hours between two date/time column

i have also created calculated column

Highlighted

## Re: Calculate hours between two date/time column

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

## Re: Calculate hours between two date/time column

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com
Highlighted
Super User VI

## 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 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

## Re: Calculate hours between two date/time column

Hi @edhans

The column is of date/time column.

Highlighted
Super User IX

## Re: Calculate hours between two date/time column

datediff =datediff(startate,enddate, HOUR)

Not hours, make sure that is correct.

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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

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

Proud to be a Super User!

Super User IX

## Re: Calculate hours between two date/time column

Yep, works

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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

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

Proud to be a Super User!

Highlighted

## Re: Calculate hours between two date/time column

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 IX

## 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.

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

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

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

Proud to be a Super User!

Announcements

#### Microsoft Ignite

This will be a conference that you do not want to miss!

#### Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

#### August Community Highlights

Check out a full recap of the month!

#### August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

#### Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors