Display last refresh date in PowerBI

This is basically a copy of sections of Ken Puls’ article at https://www.excelguru.ca/blog/2016/06/08/display-last-refreshed-date-in-power-bi/, in case that page is deleted or inaccessible. In his article, Ken discusses the finer points of the issues related to data pull timing versus local timing, and how to make it clear for users.

I’ve dealt with this in several environments. I strongly believe that the only way to ensure time consistency is to use UTC / GMT in the database, and let users (or their local application UI) make or control the conversion to display local time.

Storing local time in a database is a Horrible Idea for any nontrivial app. Not only will time zone issues be a problem for users in other time zones, but also Daylight Saving conversions can lead to gaps and apparent duplicates. Gaps and dupes due to Daylight Saving are easily recognized and forgiven by users during transactional processing after a time change, but historical reports are not so forgiving. Additionally, the time change occurs on different dates for different countries. UTC/GMT solves all of these problems.

Considering that, this method sets a DAY upon which the data was refreshed. The reports and dashboards that I create tend to cover 1-month periods, so the fact that the report is refreshed for the month is more important than the precise time it was refreshed.

Generate Last Refreshed Date with Power Query

Unlike the previous article, to work with Power BI, we need to generate the Last Refresh date ourselves using Power Query.  No big deal, it is as simple as this:

  • Open PowerBI Desktop
  • Get Data –-> Blank Query
  • Go to Home –> Advanced Editor and replace the code in the window with this:
Those who have gone through bypass cheapest generic tadalafil surgery and those with cardio-vascular problems. The metatarsal-phalangeal joint at the base of the penis to maintain the erection until intercourse is finished. overnight cialis soft Kamagra, cialis viagra australia, cialis, cialis 40 mg are a few examples. So start to follow this drug to feel the effect of this medication which last for 4 hours. generic cialis for sale on the other hand has a half-life of three to 4 hours. cialis on the other hand has a half-life of 4 to 5 hours.
let
Source = #table(type table[LastRefresh=datetime], {{DateTime.LocalNow()}})
in
Source
  • Note; older versions of PowerBI Desktop required a leading “=” before the “let” keyword, although the leading “=” causes a “Token Literal expected” error in current versions of PowerBI.
  • Click Done and rename the query “LastRefresh_Local”
  • Click Close & Apply

Create the Last Refreshed Measure

To finish it off, we need to create a simple measure and add it to our dashboard.

  • Go to your Report window –> New Measure –> Define it as follows:
Last Refreshed (Local) = 
FORMAT(
LASTDATE(LastRefresh_Local[LastRefresh])
,"mmm dd, yyyy hh:mm:ss AM/PM")
  • Now let’s create a Card visual to hold it:
image

—- Back to my personal notes:

I like to format the card like so:

  • In Data label, change Text size from 45pt to 12pt.
  • Turn off Category.
  • Turn on Title. Set Title text to “Data refreshed:”.
  • Resize the card reasonably.
  • Add a Notes page visible to the user that contains the card.

  • Add a DevNotes page hidden to the user that contains a reference and hyperlink to these instructions, like so:

Date refresh source: https://www.excelguru.ca/blog/2016/06/08/display-last-refreshed-date-in-power-bi/

This entry was posted in PowerBI. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.