web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / To get the last refres...
Power Automate
Unanswered

To get the last refresh date of particular dataset of power BI by Power automate

(0) ShareShare
ReportReport
Posted on by 80

Hello everyone,

I have a question that can we get the last refresh date of the particular dataset of Power Bi by creating a flow-on power automate?

Categories:
I have the same question (0)
  • Verified answer
    alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    Hello,

     

    I don't think it is possible yet as the only option available regarding dataset from power automate is to refresh it

     

    Best regards,

    Alaa

  • lisha Profile Picture
    80 on at

    Thanks @alaabitar ,

     

    Also Can you please tell Is there any option to get the error message via mail by power automate if any dataset refresh fails?

  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    Like any action within power automate you can always to something if a certain action fails like sending an email for example.

     

    Best regards,

    Alaa

  • tlld Profile Picture
    12 on at

    Hi @lisha , 

    I'm using a flow to check if my Power BI Dataset was updated today. Power Automate then returns me the timestamp of the latest Dataset refresh and pushes it to me via Teams or E-Mail. 
    However, you can also just use the timestamp inside your flow to run checks and maybe abort the flow if the Dataset refresh failed. 

     

    To get this working you need to follow these steps in your Power BI Datamodel that you want to get the latest refresh date from:

     

    1. Open your Power BI Data Model and 

    2. Open the Power Query Editor (Transform Data Button in the header nav of Power BI)

    3. Create a new "Blank Query" and insert the following code

    let Source = DateTime.Time(DateTime.LocalNow()) & DateTime.Date(DateTime.LocalNow())
    in Source

    4. This will return a timestamp of the latest refresh of the datamodel

     

    I named everything as the following screenshot shows:

    tlld_0-1681369915940.png

     

     

    After you completed the above steps we switch to Power Automate for the following steps:

    1. Insert a Query on a Power BI DataSet
         a) Select the workspace of your DataSet 
         b) Select your DataSet
         c) Enter the following DAX Query to get last refresh value

    // DAX Query
    DEFINE
    	VAR __DS0Core = 
    		DISTINCT('latest_refresh'[latest_refresh])
    
    	VAR __DS0PrimaryWindowed = 
    		TOPN(501, __DS0Core, 'latest_refresh'[latest_refresh], 0)
    
    EVALUATE
    	__DS0PrimaryWindowed
    
    ORDER BY
    	'latest_refresh'[latest_refresh] DESC

    2. Continue with your flow 🙂 

     

     

    It's useful to add a separate Query on your Dataset to get the last_refresh data as it might return some errors .

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard