List.Times

List

Generates a list of time values starting from a given time, with a specified count and step duration.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

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

Parameters

NameTypeRequiredDescription
starttimeYesThe starting time value.
countnumberYesThe number of time values to generate.
stepdurationYesThe duration to add between each successive time value.

Return Value

listA list of time values of length count, beginning at start and incrementing by step.

Remarks

List.Times generates a sequence of time values representing times of day (hours, minutes, seconds) without a date component. It is useful for building appointment slot lists, time-of-day dimension tables, or scheduling grids.

The step parameter uses the #duration(days, hours, minutes, seconds) syntax. For 30-minute slots use #duration(0, 0, 30, 0); for 1-hour slots use #duration(0, 1, 0, 0). If the generated time exceeds 23:59:59, it wraps around — for example, #time(23, 0, 0) with a 2-hour step produces 23:00:00 then 1:00:00.

A count of 0 returns an empty list. Use List.DateTimes when a full date-and-time value is needed. To convert the resulting list to a table for use as a dimension, use Table.FromList with Splitter.SplitByNothing() and a single column name.

Examples

Example 1: Generate hourly time slots starting at midnight

List.Times(#time(0, 0, 0), 8, #duration(0, 1, 0, 0))
Result
Result
10:00:00
21:00:00
32:00:00
43:00:00
54:00:00
65:00:00
76:00:00
87:00:00

Example 2: Generate 30-minute appointment slots

List.Times(#time(9, 0, 0), 8, #duration(0, 0, 30, 0))
Result
Result
19:00:00
29:30:00
310:00:00
410:30:00
511:00:00
611:30:00
712:00:00
812:30:00

Example 3: Create a time-of-day dimension table

let
    Times = List.Times(#time(0, 0, 0), 24, #duration(0, 1, 0, 0)),
    TimeTable = Table.FromList(Times, Splitter.SplitByNothing(), {"Hour"})
in
    TimeTable
Applied Steps

The final output — a 24-row table with one Hour column listing each hour of the day from 0:00:00 to 23:00:00.

Hour
10:00:00
21:00:00
32:00:00
4...

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks