Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
PowerAutomater
Helper IV
Helper IV

Is there a way to remove the Query prefix from column names?

I have created a table visualisation in Power Bi Desktop. I noticed that when hovering on the field there is a prefix of "Query1" which is what the data source has been named:

PowerAutomater_0-1736304418745.png


I have then added a Power Automate button/visualiser and created a flow that extracts the data and creates a csv file. The problem is though that instead of using the original columns names as the column headers, the csv file has this same "Query 1" prefix:

PowerAutomater_1-1736304614902.png


Is there a way to remove this prefix in PowerBI, so the flow doesn't use it when creating the csv?

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @PowerAutomater 

 

In the EVALUATE clause, you can use SELECTCOLUMNS to select columns from the prior tables in your query, This will remove the table names but keep the square brackets

danextian_0-1736313088005.png

If you want the square brackets removed, it's more of a Power Automate task than Power BI. You need to add a select step after Run a query against a dataset step use dynamic expressions.

danextian_1-1736314506593.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @PowerAutomater 

 

In the EVALUATE clause, you can use SELECTCOLUMNS to select columns from the prior tables in your query, This will remove the table names but keep the square brackets

danextian_0-1736313088005.png

If you want the square brackets removed, it's more of a Power Automate task than Power BI. You need to add a select step after Run a query against a dataset step use dynamic expressions.

danextian_1-1736314506593.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @PowerAutomater,

Thanks for the reply from shafiz_p.

 

Renaming directly is good if your have fewer column names to deal with, if you have multiple columns, I suggest you use the Advanced Editor to use Table.TransformColumnNames.

 

Write the M query as below:

 

#"Renamed Columns" = Table.TransformColumnNames(#"Previous Step", each Text.Replace(_, "Query1.", ""))

 

 

Here is what I have in my editor:

vqiaqimsftv_0-1736314140435.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srMVfDNLypJzStOzVPSUTIyMDIGUoZQpq6BIRApxeoAVSbmpSq45KfiUGQEUYTdOCNklRZglY45mcmpCsG5mSUZONRZ4rDWGEmRoSlYkVN+koJXfkZecX4eDnVm+JyHotIcn0oTJJVGQC/HAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CustomerID = _t, Year = _t, WeekNumber = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"CustomerID", type text}, {"Year", Int64.Type}, {"WeekNumber", Int64.Type}, {"Date", type date}}),
    #"Renamed Columns" = Table.TransformColumnNames(#"Changed Type", each Text.Replace(_, "Query1.", "")) // This removes any "Query1." prefix from column names
in
    #"Renamed Columns"

 

 

Once you’ve cleaned up the column names in Power Query, verify that the flow you’ve set up in Power Automate uses the correct headers when exporting to CSV.

 

If you have any other questions please feel free to contact me.

 

Best Regards,
Qi
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

shafiz_p
Super User
Super User

Hi @PowerAutomater 

You can open power query and rename column.

or

Use power automate to rename column after creating csv. 

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors