Forum Discussion

Applicable88's avatar
Applicable88
Icon for Impactful Individual rankImpactful Individual
5 years ago
Solved

Datetimeswitchzone function does not switch time back to "real" local time

Hello,   I'm using this function to get the right local time also on the PowerBi Service, and also for switching the daylight saving two times per year: if [Summertime/Wintertime]="S" then DateT...
  • v-jingzhang's avatar
    5 years ago

    Hi Applicable88 

     

    Since you are using the M functions in Power Query to get the local time, the time data on Power BI Service is refreshed only when the dataset is refreshed at the service not when the report is refreshed. You could refresh the dataset first, then refresh the report page to see the time update. 

     

    If you always want to show the local time on the report page regardless of whether the dataset is refreshed, you could use DAX method to get the local time. 

    Local time DAX = UTCNOW() + 2/24


    In your scenario, try 

    Local time = IF('Table'[SW]="S",UTCNOW()+2/24,UTCNOW()+1/24)


    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

  • Applicable88's avatar
    Applicable88
    5 years ago

    Hi v-jingzhang, thank you for the effort. Thats a good workaround. I also found another problem why the "information" on the utc+X time wasn't transferred into the datamodel. I had to change the datatype to the Datetimezone (which is the globe symbol) , instead I was still at Datetime only. Eventhough I see the right time it disregard the UTC+X value.

    Thx.

    Best.