Extract all data from a composite aggregation in Power BI/Power Query using after_key

Hey guys!
I'm having a challenge importing data from an elasticsearch query into Power BI. I'm making the call and the results arrive, but only the limit of 16000 results that the API allows due to performance.

I need Power BI to receive all the data from this aggregated query, has anyone had to do this?

The scroll method that is in the following link does not work in aggregated queries, and due to the large volume of data I cannot use the scroll to pull all the results, so I need to do this with the aggregated query.

The idea would be to create a kind of loop that takes the after_key value and pulls the following results until it runs out. Would anyone help me to solve this doubt?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.