DateTime.IsInNextMinute
DateTimeReturns true if the datetime falls in the next clock minute.
Syntax
DateTime.IsInNextMinute(dateTime as any) as logicalParameters
| Name | Type | Required | Description |
|---|---|---|---|
dateTime | any | Yes | A datetime or datetimezone value to test. |
Return Value
logical — true if the datetime falls within the clock minute immediately after the current minute, false otherwise.
Remarks
DateTime.IsInNextMinute returns true if the input datetime or datetimezone value falls within the clock minute immediately following the current minute, as determined by DateTime.LocalNow(). For example, if it is currently 10:32, this function returns true for any datetime between 10:33:00 and 10:33:59.9999999. The current minute is not included. The function is re-evaluated on each query refresh.
DateTime.IsInNextMinute is an extremely fine-grained predicate that is only practical in true real-time or streaming data pipelines where M queries are evaluated continuously or very frequently. In a standard Power BI dataset with scheduled refresh (hourly or daily), this function will rarely return true for any rows in your data.
For broader minute-level lookahead windows, use DateTime.IsInNextNMinutes. If you need minute-level filtering over a meaningful range, prefer computing an explicit datetime threshold such as DateTime.LocalNow() + #duration(0, 0, N, 0) and comparing directly.
Examples
Example 1: Filter log entries in the next minute
Table.SelectRows(
OrderLog,
each DateTime.IsInNextMinute([Timestamp])
)LogID | OrderID | Action | Timestamp | DurationMinutes | Notes |
|---|
Example 2: Flag next-minute entries
Table.AddColumn(
Table.SelectColumns(Table.FirstN(OrderLog, 4), {"LogID", "Timestamp"}),
"IsNextMinute", each DateTime.IsInNextMinute([Timestamp]), type logical
)LogID | Timestamp | IsNextMinute | |
|---|---|---|---|
| 1 | L001 | 1/15/2024 9:30:00 AM | FALSE |
| 2 | L002 | 1/16/2024 2:15:00 PM | FALSE |
| 3 | L003 | 1/18/2024 11:00:00 AM | FALSE |
| 4 | L004 | 1/20/2024 8:45:00 AM | FALSE |
Example 3: Combine current and next minute for a two-minute window
Table.AddColumn(
Table.SelectColumns(Table.FirstN(OrderLog, 4), {"LogID", "Timestamp"}),
"TwoMinuteWindow",
each DateTime.IsInCurrentMinute([Timestamp]) or DateTime.IsInNextMinute([Timestamp]),
type logical
)LogID | Timestamp | TwoMinuteWindow | |
|---|---|---|---|
| 1 | L001 | 1/15/2024 9:30:00 AM | FALSE |
| 2 | L002 | 1/16/2024 2:15:00 PM | FALSE |
| 3 | L003 | 1/18/2024 11:00:00 AM | FALSE |
| 4 | L004 | 1/20/2024 8:45:00 AM | FALSE |