Skip to main content

Notifications

Community site session details
Power Automate - Building Flows
Answered

Flow Create CSV from PowerBI DataQuery - Need help renaming columns in CSV

Like (0) ShareShare
ReportReport
Posted on 1 May 2024 15:55:54 by 109

Hello,

 

I have a flow working nearly perfectly. Once a day, a query is run against a PowerBI Dataset and then creates a csv, which is then emailed to a user for further automation.

But I would like to be able to control the csv column names, and  I can't figure out how to do so. I've tried everything I can think of and I've gone through CoPilot; nothing seems to work. 

Below are photos of my flow and the resulting CSV.

For column 1, the result is currently Query1[Contact ID (Contact) (Contact)]. I would like it to simply be called Contact ID. 

Photo 1: The CSV step.
Image 3 - The CSV Table Step.png

Photo 2: The result csv headers
Image 2 - The CSV Headers.png

Photo 3: The flow itself
Image 1 - The Flow.png

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 01 May 2024 at 16:05:40
    Re: Flow Create CSV from PowerBI DataQuery - Need help renaming columns in CSV

    Hi @amulhearn0207 

     

    You can choose "Custom" from 'Columns' parameter and set the column name in the header key textbox as per the need. Here is an example for State column:

    ManishSolanki_0-1714579343316.png

    Below expression needs to be added in the Function window as highlighted in the above screenshot.

    item()?['Query[State]']

    it takes column name as the index for item() function. So, apply item() function for each custom column as per the need.

     

     

     

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

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started
Loading complete