Date.IsInNextNWeeks

Date

Returns true if the date falls within the next N calendar weeks.

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

Syntax

Date.IsInNextNWeeks(dateTime as any, weeks as number) as logical

Parameters

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

Return Value

logicaltrue if the date falls within the next N weeks after the current week, false otherwise.

Remarks

Date.IsInNextNWeeks returns true if the input date falls within the next N complete Sunday–Saturday calendar weeks after the current week. The current week itself is not included; use Date.IsInCurrentWeek to also match the current week. The function is re-evaluated on each query refresh.

Weeks are always Sunday-to-Saturday boundaries — there is no parameter to use Monday-based weeks. If your organization uses Monday-based weeks, build the filter manually using Date.StartOfWeek(Date.From(DateTime.LocalNow()), Day.Monday).

This function counts complete weeks, not a rolling 7-day window. For a rolling N-day window from tomorrow, use Date.IsInNextNDays(n * 7) instead.

Examples

Example 1: Find orders due in the next 2 weeks

Table.SelectRows(
    Sales,
    each Date.IsInNextNWeeks([OrderDate], 2)
)
Result
OrderID
CustomerName
OrderDate
143Alice3/15/2026
244Bob3/20/2026

Example 2: Flag orders due in the next 4 weeks

Table.AddColumn(
    Sales,
    "DueInNext4Weeks", each Date.IsInNextNWeeks([OrderDate], 4), type logical
)
Result
OrderID
OrderDate
DueInNext4Weeks
1423/8/2026FALSE
2433/15/2026TRUE
3464/15/2026FALSE

Example 3: Combine current and next 2 weeks for a 3-week window

Table.SelectRows(
    Sales,
    each Date.IsInCurrentWeek([OrderDate]) or Date.IsInNextNWeeks([OrderDate], 2)
)
Result
OrderID
CustomerName
OrderDate
142Charlie3/8/2026
243Alice3/15/2026
344Bob3/20/2026

Compatibility

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