Date.AddWeeks

Date.AddWeeks is a function in the Power Query M language that adds a specified number of weeks to a date or datetime value. The resulting value is returned as a date, datetime, or datetimezone.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

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

Description

Returns the date, datetime, or datetimezone result from adding numberOfWeeks weeks to the datetime value dateTime.

  • dateTime: The date, datetime, or datetimezone value to which weeks are being added.
  • numberOfWeeks: The number of weeks to add.

Examples

Add 2 weeks to the date, datetime, or datetimezone value representing the date 5/14/2011.

// Output: #date( 2011, 5, 28 )
Date.AddWeeks( #date( 2011, 5, 14 ), 2 )

Other functions related to Date.AddWeeks are:

BI Gorilla Blog

Last update: August 25, 2023 | Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/date-addweeks
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.