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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Indrasena
Regular Visitor

Iterating through table values in M query and store the results in new table as records

I need to pass the Id values that are present in a Employee table to a web url
Below is the table

 

Indrasena_1-1640036210736.png

 


for each row in the above table the below command needs to be executed and store the result as a record

 

Source = Web.Contents("XXXXXXXXXXXXXXXXXXXX/employeeId="&Id, [Headers=[Authorization="Bearer "&access_token,ContentType="application/json"]]),
FormatAsJson = Json.Document(GetJson),

 

Note; I am able to pass only 1 id(Web.Contents("XXXXXXXXXXXXXXXXXXXX/employeeId="&Employee[Id]{0}) and unable to find something that loops and writes to a table.

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Indrasena ,

You can refer the content in the following links to achieve it:

Power BI Desktop Query Parameters, Part 3, List Output

Populate a Power BI parameter list using a query

1. Convert the table Employee to a list

Convert to listConvert to list

2. Create a New Query Parameter and Link it to the List Query just as the one in below screenshot

Add a new parameter and link to the listAdd a new parameter and link to the list

3. Filter the rows with the parameter

Filter the rows with parameter valueFilter the rows with parameter value

 

The below one is for Power Query online:

Multi-Value Parameters In Power Query Online

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @Indrasena ,

You can refer the content in the following links to achieve it:

Power BI Desktop Query Parameters, Part 3, List Output

Populate a Power BI parameter list using a query

1. Convert the table Employee to a list

Convert to listConvert to list

2. Create a New Query Parameter and Link it to the List Query just as the one in below screenshot

Add a new parameter and link to the listAdd a new parameter and link to the list

3. Filter the rows with the parameter

Filter the rows with parameter valueFilter the rows with parameter value

 

The below one is for Power Query online:

Multi-Value Parameters In Power Query Online

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.