Power Query: why is the timestamp in an earlier step later than in a later step?

ONE_ME 0 Reputation points
2026-11-09T01:57:31.41+00:00

let      one = Function.InvokeAfter(()=>DateTime.LocalNow(), #duration(0, 0, 0, 5)),      two = one  in      two

User's image

User's image

Microsoft 365 and Office | Excel | Other | Windows
0 comments No comments

1 answer

Sort by: Oldest
  1. AI answer

    2026-11-09T01:57:48.22+00:00

    DateTime.LocalNow() is a dynamic function. It can return a new value each time it is invoked during query evaluation.

    In Power Query, steps are defined in a let ... in expression, and later steps reference earlier steps by variable name. In the sample:

    let
        one = Function.InvokeAfter(()=>DateTime.LocalNow(), #duration(0, 0, 0, 5)),
        two = one
    in
        two
    

    one is the expression that waits 5 seconds and then evaluates DateTime.LocalNow(). two just references one.

    The reason the timestamp shown for an earlier step can appear later than the timestamp shown for a later step is that DateTime.LocalNow() is not fixed. When the editor previews steps, Power Query can evaluate expressions at different times, so the value displayed for a step preview is not guaranteed to be the same moment across all step views.

    If the same timestamp must remain constant throughout a single query evaluation, use a fixed current-time function instead, such as DateTime.FixedLocalNow(). Fixed variants return the same value throughout one query evaluation.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.