Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
irnm8dn
Post Prodigy
Post Prodigy

Last Refresh of Data

For months I have been successfully using the following DAX statement to ashow a Last Refresh Date/Time on my dashboards.  This was working with successfully, however since scheduling refrsesh using a personal gateway it seems to be in a less preferred timezone.  (For those of you wondering, I have the refresh set to Eastern which is preferred but seems tro be showing UTC on the dashboard.)

 

= DateTime.Time(DateTime.LocalNow()) & DateTime.Date(DateTime.LocalNow())

 

Looking for suggestions that will allow me to show Eastern Standard Date/Time when refreshed.

 

Thanks for the help!

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

Not to be picky, but that's Power Query "M" language, not DAX. You should be able to use:

 

DateTime.Time(DateTime.LocalNow()) + #duration(0, -5, 0, 0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Hi @irnm8dn,

 

There is a known gap for the time zone displayed in Power BI Service. The time zone in the service is effectively always set to UTC.

 

There is a workaround to display time in your current time zone. You can use following power query in the Query Editor if your time zone is 5 hours behind Coordinated Universal Time (UTC−05:00). Smiley Happy

= DateTime.Time(DateTimeZone.SwitchZone( DateTimeZone.FixedLocalNow(), -5 )) & DateTime.Date(DateTimeZone.SwitchZone( DateTimeZone.FixedLocalNow(), -5 ))

 

Regards

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Not to be picky, but that's Power Query "M" language, not DAX. You should be able to use:

 

DateTime.Time(DateTime.LocalNow()) + #duration(0, -5, 0, 0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks for the clarification.

 

Below is a representation of the output.  I was expectiing 7/13/2017 3:52:50 PM

 

Capture.PNG

Thoughts?

 

Hi @irnm8dn,

 

There is a known gap for the time zone displayed in Power BI Service. The time zone in the service is effectively always set to UTC.

 

There is a workaround to display time in your current time zone. You can use following power query in the Query Editor if your time zone is 5 hours behind Coordinated Universal Time (UTC−05:00). Smiley Happy

= DateTime.Time(DateTimeZone.SwitchZone( DateTimeZone.FixedLocalNow(), -5 )) & DateTime.Date(DateTimeZone.SwitchZone( DateTimeZone.FixedLocalNow(), -5 ))

 

Regards

Yes, see formula above. Essentially, it is adding/subtracting hours from the date/time value returned from LocalNow to account for the time zone shift. In your case it looks like you would want to use +5?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.