Display Last Refreshed/Updated Date/Time in Power BI
After creating and publishing your first Power BI report, you will look for ways to display the last refreshed/updated date or time to the user. Because everyone(including you) wants to know how fresh the data is, right?
Thanks to Power BI’s powerful M language, this task is very easy to do.
- First thing you need to do is to open Power BI Desktop.
- Then click Get Data -> Blank Query
- When the editor opens, type “= DateTime.LocalNow()” and press Enter
- This will get the date and time when the report gets refreshed. After this step, click “To Table” option you will see on left top corner
- There we are! We have our date/time column now, very few steps left before we could display our Date and Time separately.
- Next, select the column by clicking its header and change its Data Type to Date/Time
- After that, select the column by clicking its header and choose Duplicate Column
- Select the column that we copied, and change its Data Type to Date
- Select the original column and duplicate it again.
- Select the new copied column and change its Data Type to Time
- Awesome! Now we are supposed to have 3 separate columns, change their name to DateTime, Date and Time
- Click Close&Apply.
- Now you can create a card visual and use your date, time or datetime fields to show last updated time. This query will get the local date whenever it is being refreshed(manually or with a scheduled refresh).