Forum Discussion

cassidy's avatar
cassidy
Power Participant
5 years ago
Solved

Refresh Excel Pivots within Service

I've published an Excel Report, with a Power BI Dataset Connection, to a Premium Workspace.     The report has a Pivot Table connected to my Power BI Dataset that needs to be refreshed daily, howev...
  • cassidy's avatar
    cassidy
    5 years ago

    Hello v-xiaotang , thanks for the reply.

     

    Part of that helped me find a solution.  

     

    Since the file is on OneDrive, if it gets refreshed, then Power BI will pick up the changes...cool.  I still need to refresh the Excel file automatically.  

     

    I added a script to the Excel Workbook to Refresh it and then created a Power Automate scheduled flow to run the Script.

     

    Goes like this:  Power Automate runs Script > Excel workbook refreshes Power BI Dataset connection and Pivots > Power BI Service picks up the Excel workbook change

     

    Here was the script I used:

     

    function main(workbook: ExcelScript.Workbook) {
      // Refresh all data connections
      workbook.refreshAllDataConnections();
    }