List.Dates
Builds a list of dates: a start date, a number of dates, and the gap between them.
List.Dates(start, count, step)Returns: A list of date values.
What it does
List.Dates creates a run of dates in one step. You give the first date, how many dates you want, and the step, which is a duration such as one day. It is the usual way to build a calendar for a date table, or a list of days to check against a register of postings.
Syntax and arguments
start: the first date, for example#date(2026, 1, 1).count: how many dates to create.step: the gap between dates, as a duration.#duration(1, 0, 0, 0)is one day.
Example
A close calendar needs every calendar day of January 2026, so that each day can be checked for postings.
let
Days = List.Dates(#date(2026, 1, 1), 31, #duration(1, 0, 0, 0)),
AsTable = Table.FromList(Days, Splitter.SplitByNothing(), {"Date"}),
Typed = Table.TransformColumnTypes(AsTable, {{"Date", type date}})
in
Typed
Days holds 31 dates, from January 1 to January 31. The table form then has one row per day. The same pattern with a longer count builds a full date table for a year or more.
Example: a second, different use
A list of days from a start date to an end date: count = Duration.Days(EndDate - StartDate) + 1, so both ends are included.
Things to watch
- The count is the number of dates, not the last date. Calculate it when you have a start and an end.
- Adding a duration of one month is not possible with a duration. For month steps, use List.Generate with Date.AddMonths.
- A date table you build should cover every date the reports need, including the first and last days of each period.
- Splitter.SplitByNothing turns a list into a single column of a table.
In business terms
Date tables for time intelligence, calendars for close and payment schedules, and daily checks that every day has a posting all start from a list of dates. Build it once and reuse it in every report.