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.
Hi there,
Is there any way to restrict Power BI/ Power Query to respect a limit of 60 API calls per minute when loading data?
In Power BI Desktop using OData connector, I get a 503 Service Unavailable error because Power BI/ Power Query fires off too many API requests at the same time. The data I am attempting to load consists of less than 100 sales transactions, so no real volume to speak of.
Although its a server (5xx error), the SaaS application provide says in needs to be handled in Power BI to restrict the number of calls to the API, haven't found any want to configure that in Power BI so far 😞
Any suggestions would be much appreciated.
Solved! Go to Solution.
Hi @Landcrab
Yes you can use Function.InvokeAfter.
This code has a 2 second delay between web requests. Modify as needed,or post your query here for help.
You can try reducing the delay to 1 second but I'm not sure if the timing within PQ/PBI would be accurate.
let
id_list = {1 .. 5},
GetWeb = (id) => Json.Document(Web.Contents("https://jsonplaceholder.typicode.com/todos/" & Text.From(id))),
Output = List.Transform(id_list, each Function.InvokeAfter( ()=>GetWeb(_), #duration(0,0,0,2)))
in
Output
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi @Landcrab
Yes you can use Function.InvokeAfter.
This code has a 2 second delay between web requests. Modify as needed,or post your query here for help.
You can try reducing the delay to 1 second but I'm not sure if the timing within PQ/PBI would be accurate.
let
id_list = {1 .. 5},
GetWeb = (id) => Json.Document(Web.Contents("https://jsonplaceholder.typicode.com/todos/" & Text.From(id))),
Output = List.Transform(id_list, each Function.InvokeAfter( ()=>GetWeb(_), #duration(0,0,0,2)))
in
Output
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Thank you @PhilipTreacy thats the sort of thing I was after.
For anyone else looking for a simple example of this check out Chris Webb's blog post > https://blog.crossjoin.co.uk/2015/04/30/using-function-invokeafter-in-power-query/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.