DateTime.IsInPreviousSecond
DateTimeReturns true if the datetime falls in the previous clock second.
Syntax
DateTime.IsInPreviousSecond(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 second immediately before the current second, false otherwise.
Remarks
DateTime.IsInPreviousSecond returns true if the input datetime or datetimezone value falls within the clock second immediately preceding the current second (as determined by DateTime.LocalNow()). The current second is not included. The function is re-evaluated on each query refresh.
Examples
Example 1: Filter events from the previous second
Table.SelectRows(
Events,
each DateTime.IsInPreviousSecond([EventTime])
)Result
EventID | EventTime | |
|---|---|---|
| 1 | 73 | 3/8/2026 10:32:44 AM |
| 2 | 74 | 3/8/2026 10:32:44 AM |
Example 2: Flag previous-second events
Table.AddColumn(
Events,
"IsPreviousSecond", each DateTime.IsInPreviousSecond([EventTime]), type logical
)Result
EventID | EventTime | IsPreviousSecond | |
|---|---|---|---|
| 1 | 72 | 3/8/2026 10:32:43 AM | FALSE |
| 2 | 73 | 3/8/2026 10:32:44 AM | TRUE |
| 3 | 75 | 3/8/2026 10:32:45 AM | FALSE |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks