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
Anonymous
Not applicable

Using parameters to get data from dynamic url

Hello,

 

I have not been able to find a solution to my problem even tho there are similar solved problems in this forum.

What I am trying to do is use parameters (from cell*s or table*s) in an url.

 

To define the parameters I tried two different solutions.

The first one was to write the value in a table and get the value via a Query.

It looks like this:

 

let
    Source = Excel.CurrentWorkbook(){[Name="TestenParams"]}[Content],
    TestParam1 = Record.Field(Source{0},"Start")
in
    TestParam1

 

 

The other one was defined by using the built-in option of the Power Query Editor.

 

I would prefer to use the first variant but for testing purposes I tried both.

 

The next step was trying to replace a part of the url with the parameter.

A simplified example of the important part of the Query would look like this:

 

let
    TestParam1 = Start,
    Source = Json.Document(Web.Contents("https://someurl.com/somecategory/64dfg8d484-4fsd4-fwewtg1w8/records?fromHere="&TestParam1&"&toHere=1525426100", [Headers=[Accept="*/*", #"Content-Type"="application/json"]])),
    #"Converted to Table" = Record.ToTable(Source),

 

 

For some reason I have not been able to create a working url using parameters.

Most of the time I get the "Expression.Error: We cannot apply operator & to types Text and Number" error.

Why am I not able to use parameters this way?

 

Thank you.

LPLA

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Source = Json.Document(Web.Contents("https://someurl.com/somecategory/64dfg8d484-4fsd4-fwewtg1w8/records?fromHere="& Text.From(TestParam1) &"&toHere=1525426100", [Headers=[Accept="*/*", #"Content-Type"="application/json"]]))

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Source = Json.Document(Web.Contents("https://someurl.com/somecategory/64dfg8d484-4fsd4-fwewtg1w8/records?fromHere="& Text.From(TestParam1) &"&toHere=1525426100", [Headers=[Accept="*/*", #"Content-Type"="application/json"]]))

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks a lot. I was searching for some kind of conversion but couldn't find it.
Unfortunately this created a new issue.

After using the parameter I get the following error:

Formula.Firewall: Query 'Testen' (step 'Expanded Value.chargebacks') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

I already got this error when trying something very similar, but I could'nt find a way to solve it.
The solution https://community.powerbi.com/t5/Desktop/Formula-Firewall-Query-references-other-queries-so-it-may-n... seems to be correct but I can find the "Privacy" tab when going to File -> Options -> General -> Privacy Settings... but there isn't really anything for me to turn off or on.

I'll try to get this fixed because I'm trying to automate some of the time consuming steps in my workflow.
Still me original problem was solved by CNENFRNL so I will tag it as the solution.

Thank you.
LPLA

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.