Forum Discussion

Incuseg's avatar
Incuseg
New Member
3 years ago
Solved

DAX

I need help with this dax, when I substract two times and one of them is higher than the other one, it gives me a negative result. How can I resolve this problem?   Here is the Dax Im using r...
  • amitchandak's avatar
    3 years ago

    Incuseg , In date diff, first use smaller value .

     

    else we need to adjust for day end

     

    if([End Time] < [Start Time], datediff([End Time]+1, [Start Time], second) ,datediff([End Time], [Start Time], second) )