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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate to refr...
Power Automate
Answered

Power Automate to refresh Excel file

(0) ShareShare
ReportReport
Posted on by 429

Hello Everyone,

 

I have a flow that refreshes a Power BI dataset and then runs a refresh script in Excel. At first the refresh and script seemed to work just fine but recently it doesn't seem to work. In Power BI, I have 6863 rows but in the Excel file I only have 6833. Below is my Power Automate flow and the Excel script to refresh the dataset. Any ideas on what I'm doing wrong or what the issue is. Thanks!

 

nleuck_101_0-1708955194938.png

ExcelScript.png

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @nleuck_101 

     

    May be put a delay before retriving the rows present after refreshing so that data can get loaded to sheet in some time.

     

    Or do a refresh again using the same script after a delay , this can be done by using a loop , like making the run script action to run two times , each time providing a delay after refresh.

     

    Or if it does not work, could you try with below office script instead 

    function main(workbook: ExcelScript.Workbook) {
     // Get the Excel application
     let excelApp = workbook.getApplication();
    
     // Calculate all formulas in the workbook
     excelApp.calculate(ExcelScript.CalculationType.recalculate);
    
     console.log("Refresh All complete.");
    }
    

     

    Let me know whether it works for you !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • nleuck_101 Profile Picture
    429 on at

    @Nived_Nambiar 

    I put a delay before the Run script. The data only takes 20 seconds to refresh in Power BI. I'll check tomorrow but I may not notice a changes in rows until a couple days later. I'll check back on whether it works or not. Thanks!

  • nleuck_101 Profile Picture
    429 on at

    @Nived_Nambiar 

    Adding the delay did not work. I'll try using the script you provided and see if that works.

  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @nleuck_101 

     

    Trying using a loop as well and do a refresh that many times till desired rows appears (using a do until loop ) 

     

    Let me know if you need any help !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • nleuck_101 Profile Picture
    429 on at

    @Nived_Nambiar 

     

    My data source for the Excel file is Power BI. I tried the following script in Excel and it still didn't work.

     

    ExcelScript2.png

  • nleuck_101 Profile Picture
    429 on at

    Does anyone have any ideas? Thanks!

  • Joseph_Fadero Profile Picture
    670 Power Up Champ - 2025 on at

    Hi @nleuck_101,

    I have another alternative, Which maybe helpful for your use case scenario,
    You can have Power Automate to refresh the Power BI dataset, While In Excel you can connect to the semantic model,

    Joseph_Fadero_0-1710409887388.png

    Under Connection Properties 
    You can schedule the refresh based on your specific timeline

    Joseph_Fadero_1-1710409939856.png


    If the current solution meets your requirement, Kindly give a Like and Mark as a solution to help others in the community as well

  • nleuck_101 Profile Picture
    429 on at

    @Joseph_Fadero 

     

    The problem with that solution is it wants to create a pivot table. I do not want a pivot table, I just need a regular table.

  • Joseph_Fadero Profile Picture
    670 Power Up Champ - 2025 on at

    Hi @nleuck_101 ,

    You have the option to insert a table or a pivot table, It doesn't have to be a Pivot table,

    If you click on the insert table option you will be navigated to sign in, You can select the table you want your Power BI to pull in data from.

    Once you do that, It should paste as a normal table,

    Kindly feel free to like my reply and mark as a solution if it meets your requirement

  • Joseph_Fadero Profile Picture
    670 Power Up Champ - 2025 on at

    @nleuck_101 

    Joseph_Fadero_0-1710860884374.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 60 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 54

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard