List.DateTimes

List

Generates a list of datetime values starting from a given datetime, 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.DateTimes(start as datetime, count as number, step as duration) as list

Parameters

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

Return Value

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

Remarks

List.DateTimes generates a sequence of datetime values, useful for creating time-series scaffolding, generating hourly or sub-hourly intervals, or building datetime-based lookup lists for reporting.

The step parameter uses the #duration(days, hours, minutes, seconds) literal. For hourly intervals use #duration(0, 1, 0, 0), for 15-minute intervals use #duration(0, 0, 15, 0). Unlike calendar-month steps, duration-based steps are exact and will not drift. A count of 0 returns an empty list.

Choose between the related sequence functions based on what your data requires: use List.Dates when you only need date values (no time component), List.DateTimes for date-and-time without timezone, and List.DateTimeZones when timezone offset information must be preserved. Converting the result to a table using Table.FromList with a single-column splitter is the standard way to build a datetime dimension.

Examples

Example 1: Generate hourly datetimes for a day

List.DateTimes(#datetime(2024, 1, 1, 0, 0, 0), 24, #duration(0, 1, 0, 0))
Result
Result
11/1/2024 12:00:00 AM
21/1/2024 1:00:00 AM
31/1/2024 2:00:00 AM
4...

Example 2: Generate 15-minute intervals

List.DateTimes(#datetime(2024, 3, 15, 8, 0, 0), 8, #duration(0, 0, 15, 0))
Result
Result
13/15/2024 8:00:00 AM
23/15/2024 8:15:00 AM
33/15/2024 8:30:00 AM
43/15/2024 8:45:00 AM
53/15/2024 9:00:00 AM
63/15/2024 9:15:00 AM
73/15/2024 9:30:00 AM
83/15/2024 9:45:00 AM

Example 3: Create a datetime table for a week at noon

let
    DateTimes = List.DateTimes(#datetime(2024, 1, 1, 12, 0, 0), 7, #duration(1, 0, 0, 0)),
    AsTable = Table.FromList(DateTimes, Splitter.SplitByNothing(), {"DateTime"})
in
    AsTable
Applied Steps

The final output — converts the datetime list into a single-column table with each value in its own row.

DateTime
11/1/2024 12:00:00 PM
21/2/2024 12:00:00 PM
31/3/2024 12:00:00 PM
4...

Compatibility

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