Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Last Date Refresh Card

I have created a last date fresh table using this formula = Table.RenameColumns(#"Converted to Table",{{"Column1", "Last Refresh Time"}}). I've put this time into a card visual which displays the local time (EST) on the desktop version. But the card visual on the service platform returns a time 5 hours ahead. It wasn't doing this before, but it's doing it now. 

 

Help on how to get the card to display with EST on Power BI service. 

 

Thank you. 

 

 

 

 

  • You have to make sure the timezone of the date itself is set to EST. Once it runs in the service everything is based on UTC. I have a blog here that will walk you through the entire logic of it, but the bottom line is you ned to use the DateTimeZone* functions. The formula below will capture the current time no matter where you are, and switch it to eastern.

     

     

    DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),-5,0)

     

     If you already have timestamp, you should probably convert it to a timezone with the DateTimeZone.From - PowerQuery M | Microsoft Learn function. then ensure it is set to Eastern.

    Keep the field as a DateTimeZone field and it will come into the DAX Datamodel correctly.

    Note the article I linked to will also help you adjust for DST as ET is -5 or -6 depending on the time of the year.

3 Replies

  • edhans's avatar
    edhans
    Community Champion

    You have to make sure the timezone of the date itself is set to EST. Once it runs in the service everything is based on UTC. I have a blog here that will walk you through the entire logic of it, but the bottom line is you ned to use the DateTimeZone* functions. The formula below will capture the current time no matter where you are, and switch it to eastern.

     

     

    DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),-5,0)

     

     If you already have timestamp, you should probably convert it to a timezone with the DateTimeZone.From - PowerQuery M | Microsoft Learn function. then ensure it is set to Eastern.

    Keep the field as a DateTimeZone field and it will come into the DAX Datamodel correctly.

    Note the article I linked to will also help you adjust for DST as ET is -5 or -6 depending on the time of the year.

  • Anonymous's avatar
    Anonymous
    Not applicable

    This worked great! I adjusted for EST. If I have data from SQL server and the data refreshes automatically will this visual also refresh? If the SQL server refresh fails the visual will still update which means the visual and data refresh may differ correct?

    • edhans's avatar
      edhans
      Community Champion

      No, when a dataset refresh fails, the entire refresh is reverted back to previous, so you won't have tables in different states.