#duration Function of Power Query

The #duration function in Power Query is used to generate a duration value by specifying the number of days, hours, minutes, and seconds.

Syntax

#duration(
    days as number,
    hours as number,
    minutes as number,
    seconds as number
) as duration

The function takes the following numeric parameters:

Example: Let’s get the duration value and add it to the date.

Power Query M

let
    start_date = #date(2025, 3, 31),
    duration = #duration(2, 0, 0, 0),
    end_date = start_date + duration
in
    end_date 

The output of the above code is 02-04-2025.