Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
My company is rebuilding our API's so they are paginated now. The problem is, one of our parameters should be the last ID of the record however, in order to get the loop working I should get the ID of the last record and use as the parameter of the next API query. The ID's arent sequential, so summing up a value to the ID's wont work. The thing is: I need a way to get the table last record ID, get back to power query with that ID and do that loop until the API return a empty table. The flow chart would be something like this:
First request without last ID record -----> Query returns a table with ID's -------> Get ID of the last record -------> Use this ID as a parameter for the next request
Hi @Gekko1 ,
you can use the List.Generate function for it. In this blogpost I have shown a simple implementation for it:
How not to miss the last page when paging with Power BI and Power Query (thebiccountant.com)
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries