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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
paulvans182
Helper III
Helper III

Rename Query from within Advanced Editor of Invoke Function

Good morning, 

I wonder if someone can help me with this, or let me know if it is even possible.

I have 3 tables in 3 files with identical layouts.  I am re-using my script for my first table to reload the other 2 tables by using a blank query and parameter to define the name of the other two files:

 

(status)=>
let
    Source = Csv.Document(File.Contents("C:\Users\Paul\Documents\Power BI\Covid\data\time_series_covid19_" & status & "_global.csv"),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Removed Columns" = Table.RemoveColumns(#"Promoted Headers",{"Province/State", "Lat", "Long"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Country/Region"}, "Attribute", "Value"),
    #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Attribute", type date}, {"Value", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Attribute", "Date"}, {"Value", status}})
in
    #"Renamed Columns"

 

 

This works perfectly.

 

However, when I trigger the query to load my new files, the tables are automatically named:

Invoked Function

Invoked Function (2)

 

Is it possible, from within the script, to rename a query?  I realize I can just rename it manually, I am just interested if it is possible to do so.

3 REPLIES 3
JP315
New Member

Hello, did you end up finding a way to have the Invoke Function be named from the advanced editor?

Anonymous
Not applicable

Did you solve this?

I´m trying to find a way to name the tables created from a function or rename them after creation.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @paulvans182 ,

 

try this.

Import the folder and adapt the Transform File function accordingly.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.