Forum Discussion

leemat's avatar
leemat
New Member
2 years ago
Solved

PowerBI Loop/Recursive Function

I have tried for hours to get this recursive formula to work. But at best it only pulls two pages of the 15+   Can anyone see what i am doing wrong?   GetPages = (url as text, accumulatedData as ...
  • lbendlin's avatar
    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