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.
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
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.
User | Count |
---|---|
102 | |
48 | |
19 | |
13 | |
11 |