DateTime.IsInNextMinute

DateTime

Returns true if the datetime falls in the next clock minute.

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

Syntax

DateTime.IsInNextMinute(dateTime as any) as logical

Parameters

NameTypeRequiredDescription
dateTimeanyYesA datetime or datetimezone value to test.

Return Value

logicaltrue 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])
)
Result
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
)
Result
LogID
Timestamp
IsNextMinute
1L0011/15/2024 9:30:00 AMFALSE
2L0021/16/2024 2:15:00 PMFALSE
3L0031/18/2024 11:00:00 AMFALSE
4L0041/20/2024 8:45:00 AMFALSE

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
)
Result
LogID
Timestamp
TwoMinuteWindow
1L0011/15/2024 9:30:00 AMFALSE
2L0021/16/2024 2:15:00 PMFALSE
3L0031/18/2024 11:00:00 AMFALSE
4L0041/20/2024 8:45:00 AMFALSE

Compatibility

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