DateTime.IsInNextNMinutes

DateTime

Returns true if the datetime falls within the next N clock minutes.

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

Syntax

DateTime.IsInNextNMinutes(dateTime as any, minutes as number) as logical

Parameters

NameTypeRequiredDescription
dateTimeanyYesA datetime or datetimezone value to test.
minutesnumberYesThe number of minutes ahead to include. Must be a positive integer.

Return Value

logicaltrue if the datetime falls within the next N minutes after the current minute, false otherwise.

Remarks

DateTime.IsInNextNMinutes returns true if the input datetime or datetimezone value falls within the next N complete clock minutes after the current minute. The current minute itself is not included; use DateTime.IsInCurrentMinute to also match the current minute. The function is re-evaluated on each query refresh.

Examples

Example 1: Filter events in the next 15 minutes

Table.SelectRows(
    Events,
    each DateTime.IsInNextNMinutes([EventTime], 15)
)
Result
EventID
EventTime
EventName
1623/8/2026 10:40:00 AMCheck-in
2633/8/2026 10:47:00 AMAlert

Example 2: Flag events in the next 30 minutes

Table.AddColumn(
    Events,
    "InNext30Min", each DateTime.IsInNextNMinutes([EventTime], 30), type logical
)
Result
EventID
EventTime
InNext30Min
1613/8/2026 10:32:00 AMFALSE
2623/8/2026 10:40:00 AMTRUE
3643/8/2026 11:05:00 AMFALSE

Compatibility

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