Forum Discussion
Set up a tile with last refresh date and time
Hi everyone,
I was watching a video from Will Thompson and he mentioned a work around for showing the date of refresh, however he didnt show how he did it. He are the steps:
In the desktop PBI click on get data and select Blank Query. This will open up the Query editor. On the right hand side change the Name from Query1 to Last refresh date. In the formula bar enter the below code:
= DateTime.Time(DateTime.LocalNow()) & DateTime.Date(DateTime.LocalNow())
Click close and apply.
You will notice on your fields tab you will have a new item named Last refresh date. You now need to enter in a measure:
Last refresh on = "Last refreshed on: " & FIRSTDATE('Last refresh date'[Last refresh date])
No click on the card visual and insert the new measure Last refresh on.
You can now see when the dashboard was last refreshed and what time it was done.
Thanks,
Giles
22 Replies
- wynhopkins
Most Valuable Professional
Here's another approach that works for me
I picked one of my small lookup tables and added a custom column using Query.
Refreshed = DateTime.LocalNow()
I then formatted that new column to remove seconds and put the Month letters in rather than 05
I then used that column in a Card visualisation - all done. No need for a measure.
- GilesWalker
Skilled Sharer
wynhopkins - Thanks for posting how you have done this. Adding a custom column with Query is excellent.
Are you manually updating your reports, or is this through direct query/auto refresh?
Thanks,
Giles
- wynhopkins
Most Valuable Professional
Manually updating currently
I'll set up a automated refresh on Monday and see what happens to the date then
- electrobrit
Post Patron
wynhopkinsThis almost works but it does a count when i put it in the card. What am I doing wrong?
- wynhopkins
Most Valuable Professional
Hi Electrobit
If you drag a date field into a card you will get a count of date
You will need to create a measure to drag into a card, such as =Max(Sales[Date])
Dragging that measure into a card will show the latest sales date in that Card
The method I referred to earlier in this thread was about adding the refresh date to a tile in a dashboard in Power BI.com
That is is a different approach to the one I mention here
- wynhopkins
Most Valuable Professional
Thanks for sharing this everyone
I found that just using Query to add a custom column to one of my existing queries worked nicely:
Plus I just used =DateTime.Time(DateTime.LocalNow()) and then formatted the column as Date Time
- wynhopkins
Most Valuable Professional
Wierdly I just tried this with a different Power BI Desktop file and just using =DateTime.Time(DateTime.LocalNow()) doesn't give me the correct date (gives 1899 date i.e. 0) which I guess is the behaviour you'd actually expect. Not sure how the other file is doing it?
Follow up note: See solution below (must have been due to placing the extra DateTime.Time at the start whcih isn't necessary. Just used =DateTime.LocalNow()
- GilesWalker
Skilled Sharer
One thing I forgot to mention; if you are using the automatic refresh function the time in this formula will convert to US time. You need to enter this formula in the M function step with the added or minus hours you require:
= DateTime.AddZone(DateTime.LocalNow(),+10)
Thanks,
Giles
- GilesWalker
Skilled Sharer
For some reason the M formula to adjust time zone issues does not seem to work. I still just get the time of at GMT not with the plus 10 for my time zone.
Does anyone know how to fix this?
THanks,
Giles
- AndrewDang
Helper IV
Thanks GilesWalker
This is a great tip to create the last refreshed date. I have a quick question, though. My refresh date tile does not seem to refresh when I refresh data on other tables. I have to click Refresh Data on this table to get the date stamp. I am wondering if there is a quick way to link the two so that it will automatically refresh the date whenever I refresh data on other tables?
Thanks;
Andrew
- AnonymousNot applicable
I don't seem to have datetime function in my version of powerBI. Could you please suggest something else?
- acp8888Frequent Visitor
I have Power BI connected to an SSAS cube and want to track a log of update times. I have a field created to give me the last updated time but does anyone know of a way to track this information historicaly to analyze the time it takes Power BI to update from my cube?
- benjaminhoang
Helper III
I mixed your = DateTime.Time(DateTime.LocalNow()) & DateTime.Date(DateTime.LocalNow())
with the solution from this website and it is working perfectly for me with the correct time once uploaded to power bi service which we stream our dashboards in the office.
https://www.fourmoo.com/2017/03/28/power-bi-create-last-dataset-refresh-date/