Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello all!
I have a request to a webservice that returns an authorization token: fnAuthorization. I use List.Generate function to iterate function to get different tokens, but when I call fnAuthorization or update data, Fiddler show that power bi makes only one request to the service and return one token in all rows.
Does anyone know how to force power bi to make several requests of the same type instead of one? I will be glad for any help.
Result
let
result = List.Generate(
() => [i=0, res=fnAuthorization()],
each [i]<10,
each [i=[i]+1, res=fnAuthorization()],
each [res]
),
#"Converted to Table" = Table.FromList(result, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandTableColumn(#"Converted to Table", "Column1", {"SessionId"}, {"SessionId"})
in
#"Expanded Column1"
fnAuthorization
let
Source = () => let
data = Json.FromValue([Login="",Password=""]),
headers = [#"accept"="application/json; charset=utf-8", #"Content-Type"="application/json"],
web = Web.Contents("url", [ Content = data, Headers = headers, ManualStatusHandling = {404, 400}]),
result = Json.Document(web),
#"Converted to Table" = Record.ToTable(result),
#"Pivoted Column" = Table.Pivot(#"Converted to Table", List.Distinct(#"Converted to Table"[Name]), "Name", "Value")
in
#"Pivoted Column"
in
Source
I don't know at all the subject and the environment of API calls and WEB accesses, but I am interested in following the discussion.
In the meantime, I would be curious to know the result of a test that I cannot do.
you could adapt this code to your case with your function instead of f (x) and see if this "bypasses" the effect of caching
let
lf=List.Repeat({f},10),
result = List.Generate(
()=> [i=0, res=lf{i}(i)],
each [i]<10,
each [i=[i]+1, res=lf{[i]}(i)],
each [res]
),
f=(x)=>x+1
in
result
let
lf=List.Repeat({f},10),
result = List.Generate(
()=> [i=0, res=lf{i}()],
each [i]<10,
each [i=[i]+1, res=lf{[i]}()],
each [res]
),
f=()=>"get token"
in
result
the idea (probably naive) is to make believe (I don't know who or what) that they are functions call different, while instead they are the same call
Here's a simplified version. See if that can get around the cache issue. @ImkeF Any suggestion on how to avoid caching?
let
Source = List.Generate(()=>0,each _<10,each _+1),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Invoked Custom Function" = Table.AddColumn(#"Converted to Table", "SessionId", each fnAuthorization())
in
#"Invoked Custom Function"
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |