Forum Discussion

BISENSE's avatar
BISENSE
New Member
7 months ago
Solved

date changes in power bi service

I have a dax and power query measure(both in different fields) to calculate previous date. this works correctly in power bi desktop. Once I publish it to Power bi service, the date changes to two ...
  • v-karpurapud's avatar
    7 months ago

    Hi BISENSE 


    Thank you for reaching out to the Microsoft Fabric community forum.
     

    This is a common and expected behavior related to time zones. Power BI Desktop evaluates date and time functions using your local machine’s time zone (Australia), whereas Power BI Service evaluates functions such as NOW() and TODAY() in Coordinated Universal Time (UTC). This behavior is independent of the user’s location. Currently, Power BI Service does not provide a setting to change the time zone used for DAX or Power Query time evaluation. There is no Azure configuration or tenantlevel regional setting that affects how NOW() or TODAY() are calculated in the Service. To ensure consistent results after publishing, the recommended approach is to explicitly apply the appropriate Australian UTC offset in your model. This can be done in either DAX or Power Query, adjusting for daylight saving time where applicable (UTC+10 for AEST or UTC+11 for AEDT).

     

    Example- DAX):

    LocalToday = INT(UTCNOW() + (10/24))

    (Use 10 for AEST or 11 for AEDT, depending on the current daylight saving period.)

     


    Alternatively, you can handle the adjustment in Power Query.

     Example (Power Query – M):

    DateTimeZone.SwitchZone(DateTimeZone.UtcNow(), 10)
     

    Again, adjust the offset value according to your current Australian time zone.
     

     

    For more details, please refer to the Microsoft official documentation on
    NOW function (DAX) - DAX | Microsoft Learn
    Local, fixed, and UTC variants of current time functions - PowerQuery M | Microsoft Learn

     

    If you have any further questions, feel free to reach out and we'll be glad to assist.

     

    Regards,

    Microsoft Fabric Community Support Team.