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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
umutkaya79
Helper I
Helper I

Passing Parameter to URL

Hi everyone, 

I would appreciate any suggestions and thank you in advance.  

 

I created a parameter (selectedMarket) has 2 values in the list (nysio and miso are the market names) :

 

umutkaya79_0-1681880456031.png

 

And I have a data coming from a WEB through API.   I am trying to pass the selectedMarket parameter to a market value in the URL, so when I select the market from the slicer I can display the related data (market) based on the selection.  

I tried to pass the parameter in the Advance Editor. (tried as "selectedMarket" also with single qutoes and also with 

& selectedMarket &) but I am getting errors everytime. 

 

 

Trying to pass the parameter to the market name.  (Its in the middle of the URL, says nyiso)

umutkaya79_1-1681880814732.png

 

 

Parameter pops up when I am typing it with the double quotes.: 

umutkaya79_2-1681880912511.png

 

 

But it says token comma expected:

umutkaya79_3-1681880986758.png

 

 

Then I replace it with single quotes or put double double quotes around the parameter and says : No syntax errors : 

umutkaya79_4-1681881035671.png

 

 

After I hit done, I get an error : 

umutkaya79_5-1681881134261.png

 

Couldn't figure it out.  

Thank you 

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @umutkaya79 ,

 

Based on your description, I have created a simple sample:

 

let
    Source = Web.BrowserContents("https://learn.microsoft.com/en-us/dax/financial-functions-dax"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE.table.table-sm > * > TR > :nth-child(1)"}, {"Column2", "TABLE.table.table-sm > * > TR > :nth-child(2)"}}, [RowSelector="TABLE.table.table-sm > * > TR"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Function", type text}, {"Description", type text}})
in
    #"Changed Type1"

 

vjianbolimsft_0-1682046905338.png

Then created a parameter:

vjianbolimsft_1-1682046931547.png

Manage the query:

vjianbolimsft_2-1682046992763.png

Final output:

 

vjianbolimsft_3-1682047018326.png

vjianbolimsft_4-1682047031842.png

 

For more details, please refer to:

Web.Contents - PowerQuery M | Microsoft Learn

Is it possible to dynamically update the source URL with Power Query ? (microsoft.com)

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @umutkaya79 ,

 

Based on your description, I have created a simple sample:

 

let
    Source = Web.BrowserContents("https://learn.microsoft.com/en-us/dax/financial-functions-dax"),
    #"Extracted Table From Html" = Html.Table(Source, {{"Column1", "TABLE.table.table-sm > * > TR > :nth-child(1)"}, {"Column2", "TABLE.table.table-sm > * > TR > :nth-child(2)"}}, [RowSelector="TABLE.table.table-sm > * > TR"]),
    #"Changed Type" = Table.TransformColumnTypes(#"Extracted Table From Html",{{"Column1", type text}, {"Column2", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Function", type text}, {"Description", type text}})
in
    #"Changed Type1"

 

vjianbolimsft_0-1682046905338.png

Then created a parameter:

vjianbolimsft_1-1682046931547.png

Manage the query:

vjianbolimsft_2-1682046992763.png

Final output:

 

vjianbolimsft_3-1682047018326.png

vjianbolimsft_4-1682047031842.png

 

For more details, please refer to:

Web.Contents - PowerQuery M | Microsoft Learn

Is it possible to dynamically update the source URL with Power Query ? (microsoft.com)

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.