Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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,
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 34 | |
| 19 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 42 | |
| 30 | |
| 26 |