Date.IsInNextNDays

Date

Returns true if the date falls within the next N days (not including today).

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

Syntax

Date.IsInNextNDays(dateTime as any, days as number) as logical

Parameters

NameTypeRequiredDescription
dateTimeanyYesA date, datetime, or datetimezone value to test.
daysnumberYesThe number of days ahead to include. Must be a positive integer.

Return Value

logicaltrue if the date falls within the next N days after today, false otherwise.

Remarks

Date.IsInNextNDays returns true if the input date falls between tomorrow and N days from today (inclusive). Today itself is not included; use Date.IsInCurrentDay if you also need to match today. The function is re-evaluated on each query refresh.

For example, with days = 7, it matches any date from tomorrow through 7 days from now — a 7-day window starting tomorrow and ending 7 days out. This is useful for "expiring soon" alerts, upcoming deadline views, or delivery windows.

Note the boundary behavior: Date.IsInNextNDays(d, 1) matches only tomorrow and is equivalent to Date.IsInNextDay. To include today in the window, add or Date.IsInCurrentDay([OrderDate]). For a full rolling window anchored to today (including today), consider computing [OrderDate] >= Date.From(DateTime.LocalNow()) and [OrderDate] <= Date.AddDays(Date.From(DateTime.LocalNow()), N).

Examples

Example 1: Find orders due in the next 7 days

Table.SelectRows(
    Sales,
    each Date.IsInNextNDays([OrderDate], 7)
)
Result
OrderID
CustomerName
OrderDate
143Alice3/9/2026
244Bob3/12/2026

Example 2: Flag orders expiring in the next 30 days

Table.AddColumn(
    Sales,
    "DueInNext30", each Date.IsInNextNDays([OrderDate], 30), type logical
)
Result
OrderID
OrderDate
DueInNext30
1423/8/2026FALSE
2433/9/2026TRUE
3444/7/2026TRUE
4455/1/2026FALSE

Example 3: Include today in the next-N-days window

Table.SelectRows(
    Sales,
    each Date.IsInCurrentDay([OrderDate]) or Date.IsInNextNDays([OrderDate], 7)
)
Result
OrderID
CustomerName
OrderDate
142Charlie3/8/2026
243Alice3/9/2026
344Bob3/12/2026

Compatibility

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