Downloads
Power Query MDateBeginner

Date.AddDays

Adds a number of days to a date, or subtracts them when the number is negative.

Syntax
Date.AddDays(dateOrDateTime as any, numberOfDays as number) as any

Returns: The new date, or null when the input is null.

What it does

Date.AddDays moves a date forward or back by a number of days. The main finance use is a due date: an invoice dated on a given day with net 30 terms is due 30 days later. It is a simple, exact calculation, with no month rules involved.

Syntax and arguments

Example

A vendor invoice is dated September 15, 2026, with net 30 payment terms. The due date and the date that is 10 days before the due date for an early payment discount are both calculated.

let
    InvoiceDate = #date(2026, 9, 15),
    DueDate = Date.AddDays(InvoiceDate, 30),
    DiscountDate = Date.AddDays(DueDate, -10)
in
    {DueDate, DiscountDate}

The due date is October 15, 2026, because September has 30 days. The early payment date is October 5, 2026. The calculation is the same for every invoice, so one rule covers the whole list.

Example: a second, different use

Create a list of dates for the next 14 days for a cash forecast, by adding one day at a time to a start date.

Things to watch

In business terms

Payment due dates, discount deadlines, lease notice periods and warranty windows are all counted in days. A consistent day count is what makes a payables aging and a cash forecast agree with the contract terms.

Related functions

All Power Query M functions · View as Markdown · M basics