Forum Discussion

elijah2018's avatar
elijah2018
Helper I
8 years ago

Automatically change table names when Query is executed

Hi everyone, 

 

So I gather data using a function in Power Query that has as an input the table name of the table I want to download. 

The problem that I have is that the resulting table name will be ''Invoked function'', ''Invoked function(2)'' , ... etc. 

I could always change the table names manually but I would like to have it changed automatically to the name of the table that I gave the function. 

 

Is this possible ? 

 

Thanks in advane for your help 

 

Elijah 

8 Replies

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Hi elijah2018 ,

     

    Please check if you have create a table or just a custom function. If you have create a table, you can rename it by click "Source" step and change the name. If you have create a custom function, there's no table exists. If you still have doubt, for further analysis, could you post your table structure or custom function in your PBIX?

     

    Regards,

    Jimmy Tao

    • elijah2018's avatar
      elijah2018
      Helper I

      Thank you Jimmy ( v-yuta-msft ) for your interest in helping me. 
      I am very new to Power BI and  have probably just created a custom function and therefore not created a real table.
      I will try to explain what I have created. 

       

      I have a function called GetData having the following structure; 

       

      let
      Source = (datapoint as text) as table =>

          let
          Source = Csv.Document(Web.Contents("www.mydatasource.com/" & datapoint),[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None])
         in Source

      in
      Souce

      So the function takes datapoint as argument and downloads the content using Web.Contents. 
      The result is a table (?) called invoked function and if I rename the table I cant see any code generated in the ''advance editor'' . 

      What am I doing wrong ? 


      Thanks again