List.Dates Function in Power Query
The List.Dates function in Power Query is used to generate a list of dates based on a starting date, a number of dates to create, and an increment step.
Syntax
 List.Dates(start as date, count as number, step as duration) as list 
The function has the following parameters:
- start: The starting date.
 - count: Total number of dates to generate.
 - step: A duration value that defines the interval between each date (e.g., #duration(1, 0, 0, 0) for 1 day).
 
Example:
Power Query M
let
    Source = List.Dates(#date(2025,3,15),5, #duration(2,5,0,0))
in
    Source  The output of the above code is shown in the image below:

In the code format it looks like below:
Power Query M
{
    #date(2025, 3, 15),
    #date(2025, 3, 17),
    #date(2025, 3, 19),
    #date(2025, 3, 21),
    #date(2025, 3, 23)
}         Example: Generate Weekly Dates.
Power Query M
let
    Source = List.Dates(#date(2025, 1, 1), 4, #duration(7, 0, 0, 0))
in
    Source         The output of the above code is shown in the image below:
