DateTime.IsInNextNMinutes
DateTimeReturns true if the datetime falls within the next N clock minutes.
Syntax
DateTime.IsInNextNMinutes(dateTime as any, minutes as number) as logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
dateTime | any | Yes | A datetime or datetimezone value to test. |
minutes | number | Yes | The number of minutes ahead to include. Must be a positive integer. |
Return Value
logical — true 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 | |
|---|---|---|---|
| 1 | 62 | 3/8/2026 10:40:00 AM | Check-in |
| 2 | 63 | 3/8/2026 10:47:00 AM | Alert |
Example 2: Flag events in the next 30 minutes
Table.AddColumn(
Events,
"InNext30Min", each DateTime.IsInNextNMinutes([EventTime], 30), type logical
)Result
EventID | EventTime | InNext30Min | |
|---|---|---|---|
| 1 | 61 | 3/8/2026 10:32:00 AM | FALSE |
| 2 | 62 | 3/8/2026 10:40:00 AM | TRUE |
| 3 | 64 | 3/8/2026 11:05:00 AM | FALSE |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks