Forum Discussion
List.Generate performance
Please see this approach as an alternative. Also, are you able to increase the number of records returned with each web call?
Power BI - Tales From The Front - REST APIs - YouTube
Pat
- Laura_Dannisoe4 years agoFrequent Visitor
Hi
I have tried to watch the alternative in the video, but I am not quite sure how to implement that in my solution. Yes I am increasing the number of records. The limit is different for each endpoint in the API.
I thought that Buffer could decrease the performance time as it takes around 1,5 hours to refresh the report...
- ImkeF4 years agoCommunity Champion
Hi Laura_Dannisoe ,
a buffer is useful to stop re-evaluating tables or lists that will be referenced multiple times in iterators (like List.Generate, -.Accumulate, -.Transform or Table.AddColumn).
But in your iterator here (List.Generate), there is no direct list or table input (just records or scalars). Therefore you cannot use it here.
Does the function you're calling ("Resumekey_function") reference a table or a list? Then you might want to buffer that in there.
There are other things to watch out for when optimizing performance: Speed/Performance aspects – The BIccountant maybe you find a hint in there.- Laura_Dannisoe4 years agoFrequent Visitor
Hi Imke
Thank you for your answer.
The resumekey function looks like below - is there anything here I could buffer?
let
Kilde = (EndPoint as text, Resumekey as text, optional Changedate) =>
let
changedate = if Changedate = null then "" else Changedate,
url = "XXXXXXXXXXXXXX",
body = [contract=MB_Agreement,apikey=MB_Key,username=MB_User,password=MB_Password,commands={[command=EndPoint,changedate=changedate,resumekey=Resumekey]}],
data = Json.Document(Web.Contents(url,[Headers=[#"Content-Type"="application/json"], Content=Json.FromValue(body), IsRetry=true
]))[results]in data
in
KildeIt is just very frustrating that it takes 1,5 hours to refresh and 15 minutes to retrieve data from one table, so I thought there must be a way to handle this faster.
- Laura_Dannisoe4 years agoFrequent Visitor
Also the approach is using GET to my understanding right? Would prefer POST.