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!
For a dashboard im building I need to retrieve data using an API. However, within the URL of the API I need to specify an ID-like number to retrieve descriptive values. An example:
HTTPS://WWW.API_LINK.COM/category_line/(ID)/line
I have a table filled with Category_ID which I need to retrieve the data using the API above. So what i'm trying to do is:
HTTPS://WWW.API_LINK.COM/category_line/ LOOP(Category[ID]) /line.
However, the Powery Query Editor keeps telling me that I cannot combine functions like this together. Thus, I was wondering if there is any other (perhaps better) way of doing this WITHOUT changing the nature of the API.
Thanks so much in advance!
If your id is in a column called ID, you should be able to add a custom column with an expression like this.
= Web.Contents("HTTPS://WWW.API_LINK.COM/category_line/" & [ID] & "/line"
You many need to convert that column to text before this step, or use & Number.ToText([ID]) &
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Pat!
First of all, thank you for taking the time to reply!
I used your solution, however, it gives me the following error:
Expression.Error: We cannot apply operator & to types Text and List.
Details:
Operator=&
Left=https://www.api-link.com/api/category/
Right=[List]
this is the line I have in set:
Json.Document(Web.Contents(#"API URL"&"/api/Category_line/"&Number.ToText(category[id])
Thank you in advance for replying!
Kind regards,
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 37 | |
| 33 | |
| 29 | |
| 27 |
| User | Count |
|---|---|
| 133 | |
| 104 | |
| 61 | |
| 59 | |
| 55 |