Forum Discussion

roopa_123's avatar
roopa_123
Helper I
4 years ago

Last Refresh Date

Hello PowerBI Community,

I need to show the 'Last Refreshed Date' on my powerbi report in a TextBox. How do I create it using only DAX. Although I am aware of creating it using PowerQuery, but I am not allowed to touch the data model. 

Help is appreciated!

3 Replies

  • truptis's avatar
    truptis
    Community Champion

    Hi roopa_123 ,

    If you don't wish to change the data model then create this measure:

    Last Refresh date = UTCNOW()

    if UTCNOW isn't giving the accurate results, then try using this:
    Last refresh = NOW()

    roopa_123  Please mark this as a solution & hit the thumbs up if it helps you. Thanks.

    • roopa_123's avatar
      roopa_123
      Helper I

      Hi truptis ,

      Thanks for your reply.

      I've tried your solution of using NOW() measure but it is showing the current timestamp when the powerbi report is opened. Ideally it should show the time when the data model is refreshed. How can this be achieved with DAX?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi roopa_123 , 

    Please refer to the following topic to see if it helps you.

    How to add the Last Date Time refresh with two simple DAX functions 

    • Create a custom column as UTC time.If you pull data from direct source, you should create a new table and custom column by New Source/Blank Query. Why UTC? Because there is no time difference between GWT and UTC. However, GWT is a timezone while UTC is a timestandard. Click here for more details.
    DAX= Table.AddColumn(#"Renamed Columns", "Last Refresh Date Time", each DateTimeZone.FixedUtcNow(), type datetimezone)
    • Add one more custom column by DAX switch zone function: I switch from UTC timezone to my local PST timezone by -7 hours. If your local time is different more than PST, you can adjust -/+ hours based on the difference time between UTC and your local timezone.
    DAX= Table.AddColumn(#"Added Custom", "PST", each DateTimeZone.SwitchZone([Last Refresh Date Time], -7), type datetimezone)
    1. Use the PST column for the Last Refresh DateTime. This will work on the app as well. 

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.