Forum Discussion
PowerBI Loop/Recursive Function
- 2 years ago
Can anyone see what i am doing wrong?You are using a recursive function 🙂 . They are cute but mostly useless especially when you have lots of data that you have to lug around in the bowels of the recursion. It is much better to use List.Generate if possible and List.Accumulate if necessary, with a healthy helping from your browser cache. Or, if you want to be really clever and the scenario supports it (which yours unfortunately doesn't) you can spread out the API call into multiple queries for maximum parallelism and speed.
Here's an article that may be of help Handling paging for Power Query connectors - Power Query | Microsoft Learn
There's no necessity for recursive function in your case since the count of loop is fixed (=counts of tokens).
Try List.accumulate().