Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I'm fairly new using APIs for building a Power BI report. I'm sure there is an easy way to do this, but I don't know how to proceed.
I have a single pull from a REST API.
Each page in the response is 1000 rows long. I need to figure out what type of Do/While loop to insert into the Advanced Editor so that it pulls 4 pages (my output is just over 3,000 rows).
Just using pageIndex=1 and pageSize=1000 (hardcoded), after converting to a table inside the Advanced Editor, I get the text below. What should I insert into this so that I pull however many pages are required to get the full output?
Thank you in adance.
let
Source = Json.Document(Web.Contents("https://api.connect.company.com/v1/retrieve?pageIndex=1&pageSize=1000")),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"geography_name", "geography_id", "region_name", "module_id", "module_name", "time_period_formatted", "time_period", "value", "rating_name", "parent_rating_name"}, {"geography_name", "geography_id", "region_name", "module_id", "module_name", "time_period_formatted", "time_period", "value", "rating_name", "parent_rating_name"})
in
#"Expanded Column1"
Solved! Go to Solution.
Hi @paulmorgan,
You can take a look at the following document about the help functions about processing pagination api if it meet your requirement:
Helper Functions#tablegeneratebypage
Regards,
Xiaoxin Sheng
Hi @paulmorgan,
You can take a look at the following document about the help functions about processing pagination api if it meet your requirement:
Helper Functions#tablegeneratebypage
Regards,
Xiaoxin Sheng
Use a recursive function
getdata(offset,count)
Then inside that function do your API call. If the result (returned rows) is the same as the count, increase the offset by one and call the function again. If it is less, pack up, and return the collected rows back to the calling process.
Thank you for taking the time to respond.
I'm not that familiar with how to do what you suggest.
However, I will send this suggestion to someone in our development team and ask for assistance on how to implement.
Thanks again
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |