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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
googlogmob
Advocate II
Advocate II

Use calculated variable in web query with gateway

If use static web query gateway and report works well

(

   http://10.10.10.10/ERP-Orchids/hs/getting/20150101

)

But ufter I added calculated variable to link, PowerBI desktop report work well, but couldnt add gateway to report:

 

(

   v = Text.From( DateTime.LocalNow() )

   "http://10.10.10.10/ERP-Orchids/hs/getting/" & v

)

 

Is there way to use calculated variable in web query with gateway?

6 REPLIES 6
v-haibl-msft
Microsoft Employee
Microsoft Employee

@googlogmob

 

This is currently not supported. The pattern in question is not supported by static analysis, and cloud refresh does not support dynamic credential flows.

 

Best Regards,

Herbert

v-micsh-msft
Microsoft Employee
Microsoft Employee

Hi googlogmob,

If I understanding clearly, you would like to have invoke function available with data refresh, right?

Currently this is not available. And there are already ideas submitted on this topic:

Make functions refreshable when the data source is a parameter of the function

Please check it and vote if necessary.

By the way, take a look at the thread below:

How to setting a dynamic URL connection

 

Please reply back if I have any misunderstandings.

Regards

Hi Michael_Shao

This idea Make functions refreshable when the data source is a parameter of the function is about my problem..

My topic readers, please, help to make nessesary votes)

I folowed this link and tried use binary converting

 

Here is my code below

 

Query "Link"

 

let
    
    query = "Валюты",
    
    v1 ="http://" & КлиентIP & "/hs/getting/PowerBI/@nAl1t1kx5$/start?storedprocedure=" & query & "&queryparameters=СтруктураПараметраЗапроса = 'НачалоАнализа = '",
    v2 = "'; ОкончаниеАнализа = '",
    v3 = "000000';"""";",
    l = v1 & ПериодС & v2 & ПериодПо & v3,

    b2 = Text.ToBinary(l, 1251),
    textFormat = BinaryFormat.Text(225, 1251) 
in
    textFormat(b2)

 

Query "Main":

 

let
   
    Запрос =  Json.Document(Web.Contents( link4 )),
    #"Преобразование" = Table.ExpandListColumn( Record.ToTable(#"Запрос") , "Value"),

    #"Разверачивание" = Table.ExpandRecordColumn(#"Преобразование", "Value", {"Валюта", "ВалютаID"}, {"Валюта", "ВалютаID"}),
    #"Источник" = Table.RemoveColumns(#"Разверачивание",{"Name"})
in
    #"Источник"

 

In PowerBI Desktop all works fine. But not in web servise - I cant select gateway for such reports

As I think cause is in ANY function (including Text.ToBinary) in source string

Maybe somebody can help me

 

 

add ones more query

 

Query "ПериодС":

 

let
    Источник = Text.From( DateTime.LocalNow() )
in
    Источник

 

Hi googlogmob,

Have you checked the blog below?

Web.Contents(), M Functions And Dataset Refresh Errors In Power BI

Please take a look at the workaround and see if ti would help in your scenario.

Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.