Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I have a requirement to Loop through existing data source table while extracting data from another new source.
I have Table (Eg Table1) with Job ID field already loaded into PowerBI, Would like to load data from web datasource using API. This API has mandatory Job Id_ref field in it.
My requirement is to load data from API datasource for all records of JOB ID from Table1.
Appreciate your help.
Thanks in advance.
AOD
Hi , Thanks for reply .
I am trying to create function using it in other table by ADD column as below , but getting Token Literal error, unable to proceed .
let
UserName = () => (WORKER_REF as text) =>
let
Source = Json.Document(Web.Contents("https://**************/api/Roles/GetUserDetailByAzureAD?user_ref=('" &WORKER_REF& "')"),
#"Converted to Table" = Table.FromRecords({Source}),
#"Expanded Data" = Table.ExpandRecordColumn(#"Converted to Table", "Data", {"OdataContext", "businessPhones", "displayName", "givenName", "jobTitle", "mail", "mobilePhone", "officeLocation", "preferredLanguage", "surname", "userPrincipalName", "id"}, {"Data.OdataContext", "Data.businessPhones", "Data.displayName", "Data.givenName", "Data.jobTitle", "Data.mail", "Data.mobilePhone", "Data.officeLocation", "Data.preferredLanguage", "Data.surname", "Data.userPrincipalName", "Data.id"}),
#"Expanded Data.businessPhones" = Table.ExpandListColumn(#"Expanded Data", "Data.businessPhones"),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Data.businessPhones",{{"Code", Int64.Type}, {"Message", type text}, {"Data.OdataContext", type any}, {"Data.businessPhones", type any}, {"Data.displayName", type text}, {"Data.givenName", type text}, {"Data.jobTitle", type any}, {"Data.mail", type any}, {"Data.mobilePhone", type any}, {"Data.officeLocation", type any}, {"Data.preferredLanguage", type any}, {"Data.surname", type text}, {"Data.userPrincipalName", type text}, {"Data.id", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Code", "Message", "Data.OdataContext", "Data.businessPhones", "Data.givenName", "Data.jobTitle", "Data.mail", "Data.mobilePhone", "Data.officeLocation", "Data.preferredLanguage", "Data.surname", "Data.userPrincipalName", "Data.id"}),
in
#"Removed Columns",
in
UserName
That's not what I meant. Have your standard list of worker IDs as a table. Add a column that calls the API for each worker. No need to specify this as a separate function (in fact it will be counter productive as you will run into the formula firewall. Keep all your calls in the same partition.
That is straightforward Table.AddColumn functionality. What have you tried and where are you stuck?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |