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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Krish89
Helper II
Helper II

How to pass parameter values to the url in Power query

Hello,

 

I am trying to fetch the list of datasources used in all the datasets at tenant level using the below api endpoint.

https://api.powerbi.com/v1.0/myorg/admin/datasets/{datasetId}/datasources 

Below is the power query which fetches the datasources for only one dataset, but I would like to get the datasources for all the datasets in the tenant.

How can we dynamically pass parameter values to the url to get all the datasets datasources?

 

Krish89_0-1629897678916.png

 

Regards,

Krishna.

5 REPLIES 5
Krish89
Helper II
Helper II

Hi @mahoneypat ,

 

I tried your solution but getting the below error.

Krish89_1-1631613256820.png

 

Krish89_2-1631613334053.png

 

Thanks,

Krishna

 

Looks like appid is not a column, but a table.  You can add a custom column to a table that has a column called AppID and then use Json.Document(Web.Contents(..." & [AppID] & "...))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi @mahoneypat ,

 

I parse the column name called AppID but getting the below error.

Krish89_1-1631624082887.png

 

Krish89_0-1631624057268.png

 

Thanks,

Krishna

You are seeing the error because you are trying to do this in your Source step instead of in an Table.AddColumn step.  Please see the below example.  It demonstrates an error on each line (the web call is not valid), but it shows the approach you should try.  The key is to have a column with your AppID values as text and then concatenate those value on each row into the web call.  You then expand the column of tables to combine the data for all the AppIDs.

 

let
Source = {2017..2021},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "YearID"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "Custom", each Json.Document(Web.Contents("https://www.boxofficemojo.com/weekly/by-year/" & [YearID])))
in
#"Added Custom"

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mahoneypat
Microsoft Employee
Microsoft Employee

You can make a table that has a column of all your dataset IDs and then add a custom column (or invoke a custom function) with your Source expression that concatenates that ID value as text into the larger expression

 

Web.Contents("... part of URL/" & [ColumnWithDatasetID] & "/rest of url...")

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors