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 / Combine Multiple CSV t...
Power Automate
Unanswered

Combine Multiple CSV tables into one file

(0) ShareShare
ReportReport
Posted on by 4

Hi All,

 

I'm currently trying to automate a recurring email that exports data from multiple PowerBI reports and sends them out to relevant parties.

 

I've managed to do so (maybe not most efficiently), but now instead of sending each report in a separate .csv file, I want to combine them all into one file and have each report on a separate sheet.

 

I'm having issues when it comes to creating the file and actually adding the data to it.

 

This is the flow I have created, when I create the file and try to add file contents, it won't let me choose the variable which contains all the tables. If I just select all four outputs as the file content, it will just append them and make it harder to separate them later.

 

How can I add all these outputs to one file but have them on different sheets? And also after that, how can I manipulate the data in each sheet? (eg. delete column, rename column, multiply values by 100 for percentages, etc..).

 

Any help would be appreciated.


Yahia_Abbas_0-1704769768856.png

 

 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @Yahia_Abbas 

     

    You could combine the results of all array objects or table data from Power BI actions using a union() function in an expression. Further, you could pass the combined result to "Create csv table" action for creating a combined csv file.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • TrevorCity Profile Picture
    22 on at

    Hi @Yahia_Abbas


    I think you just need to add a couple more steps. 


    Firstly you are using .csv file extension in the Create file step.  Csv files cannot have multiple worksheets so you might want to try changing that to .xlsx.


    Next extending on what you have done so far, use the first table as the data for the file content, this should put it on Sheet 1 in the document.


    After creating the file you can add a Create worksheet action (from Excel for Business online connector) for each of your other tables.

     

    TrevorCity_0-1704779356111.png

     

    Once you have added the sheets you can use the Create table action to add the other tables to their worksheets, according to https://powerusers.microsoft.com/t5/Building-Flows/Create-Table-in-Excel-with-two-Worksheets/m-p/236135/highlight/true#M23185 you need to add the worksheet name when you create the table

    eg ='WORKSHEET_NAME'!outputs('create csv table x')

     

    Hope that helps,

  • Yahia_Abbas Profile Picture
    4 on at

    Hi Manish,

    Thank you for your response, but I'm not trying to combine them into one output. Yes they're all going into the same csv/excel file, but I'd like each table to be on a separate sheet.

  • Yahia_Abbas Profile Picture
    4 on at

    Hi Trevor,

    I've tried the method you suggested above, but I'm running into two problems with it.

    1. The created file won't open due to this error:

    Yahia_Abbas_0-1704940805193.png

    2. The flow is getting stuck on the create worksheet step, it won't go past it. 

     

    Any idea? Any more information you need me to provide? I've attached an image of the flow with your steps.

     

    Yahia_Abbas_1-1704940964677.png

     

  • TrevorCity Profile Picture
    22 on at

    HI @Yahia_Abbas,

    This seems to be related to the Create File action, specifically the file content.  I made a test flow and got the same error when I tried to add data when creating the file.  

    To test it I copied the file content of a blank file  and used the output to create the new file

    TrevorCity_0-1704945603546.png

     

    TrevorCity_2-1704945710977.png

     

    Hope this helps,

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard