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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Gonzalo
New Member

Change data source URL for multiple queries

I have about 10 queries that are made to a JSON / REST API.

The format of the URLs is:

http://api.accounturl.company.com/api/v2/method/?auth_key=XXXXXXXXXXXXXXXXX&format=json&parameter1=100000&parameter2=10000


Some parameters and their values change in each query.

My goal is to be able to modify the beginning of the URL including auth_key parameter "http: //api.accounturl.company.com/api/v2/method/?auth_key=XXXXXXXXXXXXXXXXX" in all queries, so that the parameters configured in each one persist.

The "RelativePath" option could be a solution.

 

I tried:

 

 

let
    Origen = Json.Document(Web.Contents("http://api.accounturl.company.com/api/v2",
        [RelativePath="/api/v2/method/?auth_key=XXXXXX&format=json&parameter1=100000&parameter2=10000"]
        )),    

 

 

This function properly, but I need to change auth_key parameter in all queries.

 

 

So, I tried this:

 

let
    Origen = Json.Document(Web.Contents("http://api.accounturl.company.com/api/v2/method/?auth_key=XXXXXXX",
        [RelativePath="&format=json&parameter1=100000&parameter2=10000"]
        )),    

 

By this way, the DataSourcePath/URL is incorrect:

 

    DataSourcePath=http://api.accounturl.company.com/api/v2/method/&format=json&parameter1=100000&parameter2=10000


    Url=http://api.accounturl.company.com/api/v2/method/&format=json&parameter1=100000&parameter2=10000?auth_key=XXXXXXXX

 

 

poderbi.png

 

 

I am starting to use PowerBI, maybe there is a simpler solution.

 

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

Seems like you might want to use query parameters? Tough to say exactly.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors