List.Durations

Updated on

List.Durations is a Power Query M function that generates a list of duration values with a specified count, starting point, and step increment. The function returns a list of duration values incremented by the given duration value.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

List.Durations(
   start as duration,
   count as number,
   step as duration,
) as list

Description

Returns a list of count duration values, starting at start and incremented by the given duration step.

Examples

Create a list of 5 values starting with 1 hour and incrementing by an hour.

List.Durations( #duration( 0, 1, 0, 0 ), 5, #duration( 0, 1, 0, 0 ) )

 /* Output: 
{
    #duration( 0, 1, 0, 0 ),
    #duration( 0, 2, 0, 0 ),
    #duration( 0, 3, 0, 0 ),
    #duration( 0, 4, 0, 0 ),
    #duration( 0, 5, 0, 0 )
}
 */ 

Other functions related to List.Durations are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/list-durations