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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Web based XML Query dynamic values

Hi all,

 

 

We run a 3rdparty system which I can get information from via XML as well as the GUI. I would like to use this to bring in information into PowerBi. The way I access the data is through an XML query string.

https://3rdpartyapp.com/API-Token=123456?QUERYSTRING

 

I would like to obtain information about a customers address I need to input the clientID...

https://3rdpartryapp.com/API-Token=123456?Client_Address&ClientID=09876

 

The problem is I want this information for all my clients at the same time and not choose 1 at a time. I looked at using parameter query and where by I could update the query being run to return by results what I would like to do is run the query against all ClientID's which I have stored in another dataset in PowerBi. 

 

Any help would be appricated as I'm sure my brain is turning a slight yellow and black colour. 

 

Many thanks

Justin

1 REPLY 1
Anonymous
Not applicable

You can do this with some M. You need to start with a list of your client IDs, and from there you can do a simple List.Transform to iterate out all the URLs you want to hit.

 

For example, if I have:

Identifiers = 
    let
        x = {1..20}
    in
        x;

Test = 
    let
        Source = List.Transform(Identifiers, 
            each "http://api.population.io/1.0/population/1980/" & "United States" & "/" & Text.From(_) & "/")
    in
        Source;

Calling "Test" will show a list of the URLs:

 

devenv_2017-07-24_12-14-05.png

 

 

From here, I know we can call Json.Document(Web.Contents(url)) on each one, (or Xml.Document() in your case). So in Power BI, I can use the Advanced Editor feature to create this. On both of these tables, I'm starting with "Blank Query", but you might already have your Client IDs. Make sure you isolate those to a List, rather than a table.

 

PBIDesktop_2017-07-24_12-18-34.png

 

PBIDesktop_2017-07-24_12-19-32.png

 

I used the GUI to "cheat" here and autogenerate those last 3 lines to extract the values out of the JSON objectsI used the GUI to "cheat" here and autogenerate those last 3 lines to extract the values out of the JSON objects

 

I hope this sets you down the right track. Basically, you're looking to generate URLs and just pass each one to a Web content function, and then an XML parsing function.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors