Forum Discussion

JBorja's avatar
JBorja
Frequent Visitor
2 years ago

Power Automate Dataset Refresh, Last Refresh Date

Hello all,

 

I have a report in which I've embedded a Power Automate button that refreshes the Dataset when clicked.

 

I want to have a "Last Refreshed" date/time stamp to let the user know how fresh their data is and indicate a refresh failure. The main method I have found and tried is creating a query with DateTime.LocalNow() then using a card to display the time. This works great when I use the Refresh option within Desktop. However, this does not update when I use the Power Automate button. I am certain the Dataset refreshed because the refresh timestamp is updated in my workspace.

 

Does anyone know a solution?

4 Replies

  •  

    a Power Automate button that refreshes the Dataset when clicked.

     

    No, it doesn't.  All it does is request a dataset refresh.  There is no guarantee that the request will be honored, and no guarantee as to long it will take or if it will be successful.

     

     

    I want to have a "Last Refreshed" date/time stamp to let the user know how fresh their data is

     

    That's the right idea but the wrong approach.  Ignore all the dataset refresh stuff. Find a data point in your actual date (for example "Latest order date") and use that to indicate the freshness of the data.

     

    All the other timestamps are pointless at best and misleading at worst.

    • JBorja's avatar
      JBorja
      Frequent Visitor

      No, it doesn't.  All it does is request a dataset refresh.  There is no guarantee that the request will be honored, and no guarantee as to long it will take or if it will be successful.


      If the dataset in the workspace shows the refresh timestamp as the time of the button click, that indicates a successful refresh, right? If so, the button has been operating as intended. Part of my intention with the timestamp is to indicate such failed requests.

       

      That's the right idea but the wrong approach.  Ignore all the dataset refresh stuff. Find a data point in your actual date (for example "Latest order date") and use that to indicate the freshness of the data.

       

      All the other timestamps are pointless at best and misleading at worst.


      The dataset doesn't contain any such dates.

       

      I appreciate your advice on best practices, and I'll likely implement them in future practices, but I'd really just like to know if there's an equivalent solution to having the query for DateTime.LocalNow() that updates the timestamp when the "Refresh" button is used in Power BI Desktop.

      • lbendlin's avatar
        lbendlin
        Super User
        If the dataset in the workspace shows the refresh timestamp as the time of the button click, that indicates a successful refresh, right?

        No, that's just showing when the refresh attempt started. Says nothing about the duration or the success.

         

        Power BI Service will happily refresh stale data over and over. This can tell you that the refresh mechanics work, but will not be useful for your report users.

         

        The dataset doesn't contain any such dates.

        Look again, or maybe add your own column based on upstream processing  (file last modified date time, for example)

  • Anonymous's avatar
    Anonymous
    Not applicable

    In this where the last refresh date time stamp does not update when using the Power Automate Button, is expected, when you use the refresh option within pbi desktop, it updates the date time. LocalNow() value because it's running within the context pf pbi desktop. When you are trigger a refresh using Power Automate or any other external method, it wont update the datetime.LocalNow() value in PBI report because the report and the refresh process are separate.

     

    Use a data source timestamp, the load the timestamp into your model and after that display the timestamp in your report.

     

     

    In Power Query go to Home after that Manage Queries after that New Source and Blank query and in the formula bar add DAX in which create a calculated table with the "Last Refreshed" timestamp.

     

     

    let
    Source = #table({"Last Refreshed"}, {{DateTime.LocalNow()}})
    in
    Source

     

     

    Click on done to create the query, and then load it into ypur data model. In your report, use a card visual to display the "Last Refreshed" timestamp from the calculated table.