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 Automate
Unanswered

Rename Excel Columns

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

Currently, I am working on automating the sending of a report (in my case, a data matrix with filters) for the company where I am doing my internship. The idea is to retrieve this matrix from Power BI, transform it into a CSV file using Power Automate, then convert it into an Excel file, and finally upload it to a folder using Azure Blob Storage.


What I have done so far:

  1. Retrieving the DAX code: I retrieved the DAX code for my matrix from Power BI through View > Performance Analyzer.

  2. Setting up a trigger in Power Automate: I created a trigger in Power Automate to execute the process every Friday at 4 PM.

  3. Running the DAX query: I added a "Run a query against a dataset" action in Power Automate to execute the DAX code. This allowed me to retrieve the data from the Power BI service. Using my credentials, I accessed my workspace and the corresponding report.

  4. Transforming into a CSV file: I used the "Create CSV table" action in Power Automate to transform the data into a CSV file.

  5. Creating an Excel file from a template: 

    • I created a blank Excel file as a template in SharePoint, which I retrieved using the "Get file content using path" action in Power Automate.
    • Then, I added a script found online to transform the CSV file into an Excel file. I inserted this script into the "Automate > New Script" menu of the Excel template.
  6. Creating and modifying the Excel file:

    • I used the "Create file" action in Power Automate to generate an Excel file based on the template, with a name that includes the current date and the template ID.

    • Next, I executed the script using the "Run script" action, specifying the ID of the Excel file and the script to use.
  7. Uploading to Azure Blob Storage: I used the "Get file content using path" action to retrieve the Excel file, and then I uploaded it to an Azure Blob Storage folder using the credentials provided.

 

My current issues

  1. Renaming columns in the Excel file before uploading to Azure Blob Storage: I want to modify the column names in the final Excel file before uploading it to the Blob.
  2. Combining two matrices (from two Power BI reports): We have two CRMs (Angers and Nantes) and therefore two Power BI reports with data matrices. I would like to know if it is possible to retrieve both matrices, combine them vertically (since the columns have the same names), and upload the final merged file to the Blob.

Thank you in advance for your advice and feedback! 😊

Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    You are almost there with your current approach. There is a YouTube tutorial that will show you how to create a spreadsheet and add columns. You might need to modify what you're doing a little, but using the action to get the file content to retrieve the Excel file is the correct approach. You just need a clean spreadsheet and create the columns each time, which this video will show you how to do: https://youtu.be/RB_ySjhm9Sg?si=Mvu3KchqKyWtvPOU

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard