DateTime.IsInCurrentSecond

DateTime

Returns true if the datetime falls within the current second.

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

Syntax

DateTime.IsInCurrentSecond(dateTime as any) as logical

Parameters

NameTypeRequiredDescription
dateTimeanyYesA datetime or datetimezone value to test.

Return Value

logicaltrue if the datetime falls within the current clock second, false otherwise.

Remarks

DateTime.IsInCurrentSecond returns true if the input datetime or datetimezone value falls within the same clock second as now (as determined by DateTime.LocalNow()). The second window spans HH:MM:SS.0000000 to HH:MM:SS.9999999. The function is re-evaluated on each query refresh.

Due to the precision of query evaluation timing, this function is primarily useful in high-frequency streaming or event-processing scenarios.

Examples

Example 1: Filter events from the current second

Table.SelectRows(
    Events,
    each DateTime.IsInCurrentSecond([EventTime])
)
Result
EventID
EventTime
1503/8/2026 10:32:45 AM
2513/8/2026 10:32:45 AM

Example 2: Flag current-second rows

Table.AddColumn(
    Events,
    "IsCurrentSecond", each DateTime.IsInCurrentSecond([EventTime]), type logical
)
Result
EventID
EventTime
IsCurrentSecond
1493/8/2026 10:32:44 AMFALSE
2503/8/2026 10:32:45 AMTRUE

Compatibility

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