Forum Discussion
Finding difference in hours between two dates.
- 9 years ago
Hi Dude ,
Did u tried this one ,
Duration3 = if ( Isblank('prod agenttask'[TaskStartTime])=true() || Isblank('prod agenttask'[TaskEndTime])=true ||
'prod agenttask'[TaskStartTime] > 'prod agenttask'[TaskEndTime],
Blank(),
DATEDIFF ( 'prod agenttask'[TaskStartTime], 'prod agenttask'[TaskEndTime], MINUTE )
)
Am sure it will help u .
Note :
Check Both Date column Data Type.
If not solve your prob share your data i will help uuuuuu
- 9 years ago
This is the limitation of the DATEDIFF() function in DAX. An error is returned if start_date is larger than end_date. For more details, please see: DATEDIFF Function (DAX). So in your scenario, you have to apply condition (like IF statement) to make the end date larger than start date.
Regards,
Hi Dude ,
Did u tried this one ,
Duration3 = if ( Isblank('prod agenttask'[TaskStartTime])=true() || Isblank('prod agenttask'[TaskEndTime])=true ||
'prod agenttask'[TaskStartTime] > 'prod agenttask'[TaskEndTime],
Blank(),
DATEDIFF ( 'prod agenttask'[TaskStartTime], 'prod agenttask'[TaskEndTime], MINUTE )
)
Am sure it will help u .
Note :
Check Both Date column Data Type.
If not solve your prob share your data i will help uuuuuu
Hi Baskar,
I was looking at your solution and I would like to use it for my visualization, but it returns only 00:00.
I want to add a new column in my data set that shows the hours it took to resolve a ticket from the beginning (Date) to end (Updated). Both columns date types are Date/Time, also the new column. There are no nulls or blanks and no dates in the Updated columns are smaller than Date column. What am I doing wrong?