Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Iterate over the Column [URLs] then replace that URL in Power Query source

Hi, i've been trying everything now still could not make it work

 

I've working on REST API and get the data from power BI service. So i need to get the source URLs which is static:

They have one Workspace with contain mulitiple datasets.

Here i get all the workspaceID and onther Table i get Dataset but does not have workspace id. However i want to loop over it by using URLs to make it dynamic.

https://drive.google.com/file/d/14NBGnJuK1EjmTnNFu_XGZbJ4drcZPwn_/view?usp=sharing 

https://drive.google.com/file/d/14RaCMR1batK4-HBYqGJx82h06_MTESAx/view?usp=sharing 
PLease the image 

1 is Table and onther is Query

The table have a column that have URLs. And Query have syntax to get data from REST API
So, i want to iterrate the URLs row and input it to the Query

 

  • Hi Anonymous 

     

    You could first transform the Query into a custom function which requires a parameter for the URL string, just like below. Let's call it fQuery. 

     

    Then go to the Table that has URLs, add a new column by invoking this custom function. Use URLs column for the File Parameter. This custom function will be invoked for every row in the table. 

     

    This is a more detailed document about Using custom functions in Power Query - Power Query

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

1 Reply

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Anonymous 

     

    You could first transform the Query into a custom function which requires a parameter for the URL string, just like below. Let's call it fQuery. 

     

    Then go to the Table that has URLs, add a new column by invoking this custom function. Use URLs column for the File Parameter. This custom function will be invoked for every row in the table. 

     

    This is a more detailed document about Using custom functions in Power Query - Power Query

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.