Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Duration.days returning false values (Power Query)

Hello Everyone, 

 

I am using duration.days to calculate the duration between two dates. But the result is sometimes right and sometimes wrong. 

For example between 28/04/2020 and 04/05/2020 it should returns 7, it returns 6

And between 05/05/2020 and 06/05/2020 it returns the correct result which is 1.

 

 

9 Replies

  • Go To >> Power Query >> Select first date then Select subtract date column >> Add column tab >> from Date & time >> Date drop down >> click subtract day >> you got your answer correct.

    >>first date is exluding it is not including.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Still showing 6 instead of 7

    • Mahesh0016's avatar
      Mahesh0016
      Super User

      because of 28/04/2020 is excluding it is not including.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        I don't think so, because it gives correct results for other dates, like 04/05/2020 and 07/05/2020. it returns 3