DateTimeZone.LocalNow
DateTimeZoneReturns the current local date and time with UTC offset as a datetimezone value.
Syntax
DateTimeZone.LocalNow() as datetimezoneReturn Value
datetimezone — The current local date, time, and UTC offset.
Remarks
DateTimeZone.LocalNow returns the current local date and time including the UTC offset as a datetimezone value. Unlike DateTimeZone.FixedLocalNow(), this function may return different values if called at different points during a long-running query evaluation — each call captures the clock at that moment. For a consistent snapshot across all rows and calls, use DateTimeZone.FixedLocalNow() instead.
In Power BI Service scheduled refreshes, the "local" time reflects the time zone of the on-premises gateway (for gateway-connected data sources) or the cloud region's system time (for cloud connectors and imported data). This is often UTC or a cloud region's configured timezone, not the developer's local machine timezone. Always test cloud refresh behavior to confirm the offset is what you expect.
DateTimeZone.LocalNow() is most useful in ad-hoc M expressions where you need the current moment with its offset and a single call is sufficient. For calculated columns or queries where multiple rows must share the same "now" reference, always capture DateTimeZone.FixedLocalNow() in a let binding and reference that variable.
Examples
Example 1: Show current local time with timezone offset
#table(
type table [LocalNow = datetimezone],
{{DateTimeZone.LocalNow()}}
)LocalNow | |
|---|---|
| 1 | 3/8/2026 4:00:00 PM |
Example 2: Add a refresh timestamp column using the fixed variant
let
RefreshTime = DateTimeZone.FixedLocalNow()
in
Table.AddColumn(
Table.SelectColumns(Table.FirstN(Sales, 3), {"OrderID"}),
"RefreshedAt", each RefreshTime, type datetimezone
)OrderID | RefreshedAt | |
|---|---|---|
| 1 | 1 | 3/8/2026 4:00:00 PM |
| 2 | 2 | 3/8/2026 4:00:00 PM |
| 3 | 3 | 3/8/2026 4:00:00 PM |
Example 3: Filter orders from the current calendar day using local time
let
Today = Date.From(DateTimeZone.LocalNow())
in
Table.SelectRows(Sales, each [OrderDate] = Today)OrderID | CustomerName | Product | Category | UnitPrice | Quantity | OrderDate | Region |
|---|