Search code examples
powerbidaxpowerquerym

How to create datediff calculation in Power Query


Is there a way I can use Datediff in Power Query as a calculated column?

This is the calculation I would like to do:

datediff("minute",[Login Time],[Logout Time])

The login time and logout time columns look like this:

enter image description here

I would greatly appreciate your suggestions. Thanks.


Solution

  • You can use the Duration functions. First create the direction:

    Duration.From([EndDate] - [StartDate])
    

    Then you can use Duration.TotalMinutes(Durationvalue)