Forum Discussion

AMD0791's avatar
AMD0791
Icon for Advocate IV rankAdvocate IV
10 months ago
Solved

PowerQuery LocalNow() timezone *not* UTC in the service

 

The documentation here indicates that LocalNow() in PowerQuery will return UTC time in the service.

Local, fixed, and UTC variants of current time functions - PowerQuery M | Microsoft Learn

 

I have put together a demo report and the results I'm seeing is that LocalNow() is returning a time that is not UTC when refreshing in the service.  When I refresh, the time returned is UTC -7, which happens to match my local desktop time (which makes it a bit harder to guess the source of the timezone choice).  The displayed time stays the same for users across the country, so it's not doing some sort of local adjustment per user.  

 

I found one comment that suggested it's the timezone defined for the tenant.  How do I find that?

The DAX formulas for Now() return time in UTC in the service.

 

What determines if  LocalNow() (powerQuery) or Now() (DAX) in the service returns UTC (as specified in documentation), or if it returns some other time?

 

Thank you!

  • Thank you for your response, except you missed the key point.  When I publish to the service and refresh the data in the service, the results for LocalNow() in PowerQuery are UTC -7, and not UTC as specified in the documentation.   LocalNow() returns UTC -7 and UTCNow() returns that actual UTC time.   I'm trying to determine how it decides to use that timezone for LocalNow() instead of UTC.

5 Replies

  • Hi AMD0791 

     

    All the servers across Power BI in the world are all set to UTC. So when you are using localnow() and you upload it to the Power BI service it will then use UTC. What I would recommend doing is to offset this with a duration in your PBX so that when it is uploaded to the service it will then correct itself. 


    + #duration(0,10,0,0)

    The code above will add 10 hours to the current Date Time 

    • AMD0791's avatar
      AMD0791
      Icon for Advocate IV rankAdvocate IV

      Thank you for your response, except you missed the key point.  When I publish to the service and refresh the data in the service, the results for LocalNow() in PowerQuery are UTC -7, and not UTC as specified in the documentation.   LocalNow() returns UTC -7 and UTCNow() returns that actual UTC time.   I'm trying to determine how it decides to use that timezone for LocalNow() instead of UTC.

  • Hi AMD0791 

     

    That is really interesting because as per the documentation it should all be returning the time in UTC. If that is happening in your case, I would rather use the UTCnow() function and then use the duration offset to ensure that the term is always accurate as expected.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AMD0791 

    Thank you for reaching out to the Microsoft Fabric Forum Community.

    GilbertQ Thanks for the inputs

    I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi AMD0791 

      I wanted to check if you had the opportunity to review the information provided by user. Please feel free to contact us if you have any further questions.