Date.AddWeeks

Date

Adds a specified number of weeks to a date value.

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

Syntax

Date.AddWeeks(dateTime as any, numberOfWeeks as number) as any

Parameters

NameTypeRequiredDescription
dateTimeanyYesThe date, datetime, or datetimezone value to add weeks to.
numberOfWeeksnumberYesThe number of weeks to add. Use negative values to subtract weeks.

Return Value

anyThe date resulting from adding the specified number of weeks to the input value.

Remarks

Date.AddWeeks adds or subtracts a whole number of weeks (7-day periods) from a date, datetime, or datetimezone value. Date.AddWeeks(d, n) is equivalent to Date.AddDays(d, n * 7), but is more self-documenting when the intent is explicitly to shift by weeks. Passing a negative numberOfWeeks subtracts weeks. The return type matches the input type.

Unlike Date.AddMonths, week arithmetic is always exact: there is no end-of-month clamping to worry about, since every week is exactly 7 days regardless of the calendar month boundaries. This makes Date.AddWeeks safe to use in rolling window calculations.

Use Date.AddWeeks when your business logic is expressed in weeks — for example, a 2-week lead time, a 4-week rolling period, or a billing cycle measured in weeks. For day-precise shifts, use Date.AddDays directly.

Examples

Example 1: Add a 2-week lead time to each order date

Table.AddColumn(
    Table.SelectColumns(
        Table.FirstN(Sales, 5),
        {"OrderID", "OrderDate"}
    ),
    "ShipByDate", each Date.AddWeeks([OrderDate], 2), type date
)
Result
OrderID
OrderDate
ShipByDate
111/15/20241/29/2024
221/18/20242/1/2024
332/1/20242/15/2024
442/10/20242/24/2024
553/5/20243/19/2024

Example 2: Subtract one week from a date

#table(
    type table [Today = date, LastWeek = date],
    {{#date(2024, 3, 15), Date.AddWeeks(#date(2024, 3, 15), -1)}}
)
Result
Today
LastWeek
13/15/20243/8/2024

Example 3: Build a 4-week rolling window start date

Table.AddColumn(
    Table.SelectColumns(
        Table.FirstN(Sales, 5),
        {"OrderID", "OrderDate"}
    ),
    "WindowStart", each Date.AddWeeks([OrderDate], -4), type date
)
Result
OrderID
OrderDate
WindowStart
111/15/202412/18/2023
221/18/202412/21/2023
332/1/20241/4/2024
442/10/20241/13/2024
553/5/20242/6/2024

Compatibility

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