DateTimeZone.FixedLocalNow

DateTimeZone

Returns the current local date and time with UTC offset, fixed for the entire query evaluation.

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

Syntax

DateTimeZone.FixedLocalNow() as datetimezone

Return Value

datetimezoneThe local date, time, and UTC offset at which query evaluation began.

Remarks

DateTimeZone.FixedLocalNow returns the current local date and time including the UTC offset as a datetimezone value, fixed to the moment query evaluation began. Unlike DateTimeZone.LocalNow(), all calls to DateTimeZone.FixedLocalNow() within a single query will return the same timestamp, making it suitable for consistent time-based calculations.

Use this function when you need a stable, timezone-aware reference point across multiple computed columns or transformation steps in a single query.

Examples

Example 1: Calculate time since each event with a stable local timestamp

let
    Now = DateTimeZone.FixedLocalNow(),
    Source = Table.SelectColumns(Table.FirstN(Events, 4), {"EventID", "EventTime"}),
    WithElapsed = Table.AddColumn(Source, "HoursSince",
        each Duration.TotalHours(DateTimeZone.RemoveZone(Now) - [EventTime]),
        type number)
in
    WithElapsed
Applied Steps

The final output — the WithElapsed table showing each event's elapsed hours since occurrence, computed from a single fixed local timestamp.

EventID
EventTime
HoursSince
111/15/2024 8:30:00 AM18,805.50
223/1/2024 2:00:00 PM17,694

Example 2: Return the fixed local now with timezone

#table(
    type table [FixedLocalNow = datetimezone],
    {{DateTimeZone.FixedLocalNow()}}
)
Result
FixedLocalNow
13/8/2026 4:00:00 PM

Compatibility

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