🚀 Power BI Quick Tip: Displaying Data Refresh Time with Time Zone Adjustment
Credit: Freepik.com

🚀 Power BI Quick Tip: Displaying Data Refresh Time with Time Zone Adjustment

Power BI dashboards offer dynamic insights, but how do you keep track of when your data was last updated? 📊

For anyone working with frequent updates or time-sensitive reports, it's crucial to have a "Last Refreshed" timestamp displayed prominently.

Here’s a simple solution using Power Query to account for time zones!

By adding a data refresh timestamp adjusted for your region, you provide your users with real-time information they can trust.

Steps shown here will help you achieve that!

Step 1: Open Power Query Editor

  • In your Power BI desktop, go to the Home tab.
  • click on New SourceBlank Query.

Article content

On the Query editor right click on the blank query and advanced editor as shown below

Article content

Step 2: Add a New Query for Refresh Time

  • In the formula bar (or the Advanced Editor), paste the following code:

Article content
✅ This snippet grabs the current UTC time and adjusts it to your local time zone (in this case, UTC+3 for East Africa Time).


let

    RefreshTime = DateTimeZone.SwitchZone(DateTimeZone.FixedUtcNow(), 3)

in

    RefreshTime
        

Step 3: Name Your Query

  • Rename your query to something meaningful like "Datetime" by right-clicking on the query and selecting Rename.

Step 4: Load the Query into Your Report

  • Click Close & Apply to load the data into your Power BI model.

Step 5: Add the Time to Your Dashboard

  • Create a new measure and paste the code below to show the refreshed time
  • Create a Card visual in your report.
  • Drag and drop the Refresh Time field into the card visual.
  • Format the card to display the timestamp clearly.


RefreshTimeMessage = 
"Data refreshed on " & FORMAT(SELECTEDVALUE(Datetime[Datetime]), "dd mmm yyyy hh:mm:ss AM/PM")        



Article content
Incorporating this into your dashboard gives users confidence in the freshness of the data, which is essential for any data-driven decision-making.

Follow me for more Power BI and data transformation tips! Cheers. Happy Daxing.


To view or add a comment, sign in

More articles by Stephen Sila

Insights from the community

Others also viewed

Explore topics