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 )
}
*/
Related functions
Other functions related to List.Durations are:
- List.Accumulate
- List.DateTimeZones
- List.DateTimes
- List.Dates
- List.Generate
- List.Numbers
- List.Random
- List.Times
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy