Forum Discussion

mh20221111's avatar
mh20221111
Icon for Helper II rankHelper II
2 months ago
Solved

Date.From(datetimezone) returns different results when using On-Premises Gateway

Hi all, I found what appears to be a date conversion inconsistency in Power BI Dataflow Gen1 when an On-Premises Data Gateway is used. Power BI Dataflow Gen1 Power BI Service Same workspace Sa...
  • SamInogic's avatar
    2 months ago

    Hi,

    This looks like a timezone handling difference between the Power BI Service and the On-premises Data Gateway, rather than an issue with Date.From() itself.

    Date.From(JST) is working with a datetimezone value, so the gateway may be applying its local/system timezone when converting it to a date. DateTimeZone.RemoveZone(JST) removes the timezone information first, which is why Date2 remains unchanged.

    Since the behavior differs between execution with and without the gateway, I would treat this as a gateway/runtime timezone inconsistency and avoid relying on implicit timezone conversion.

    As a workaround, explicitly remove or apply the required timezone before extracting the date, for example:

    Date.From(DateTimeZone.RemoveZone(JST))

    Also check the gateway machine's regional/timezone settings, as these can influence datetime conversions.

    If the same M code produces different results in the Service depending only on whether the gateway is used, it would be worth raising this with Microsoft Support as a potential gateway/Dataflow Gen1 issue.

    Hope this Helps!

    Thanks