Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi,
I have the following looping API call in PowerBI desktop, is there anything I can add/change so that it loops for say only the first 1000 records (10 pages) instead of returning all records?
let
ufnQuery = (n) =>
let
jsonDoc= Json.Document(
Web.Contents(
"[replace this with web address]/?&start=" & Number.ToText(n))),
result = jsonDoc[result],
records = result[records],
tmpTbl = Table.FromList(records, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
tmpTbl,
fnRecursive = (tbl, n) =>
if Table.RowCount(ufnQuery(n)) > 0 then @fnRecursive(Table.Combine({tbl, ufnQuery(n)}), n+100) else tbl,
tbl = ufnQuery(0),
final = fnRecursive(tbl ,100),
#"Expanded Column1" = Table.ExpandRecordColumn(final, "Column1", {"id", "start", "answer", "end", "src", "dst", "from_number", "to_number", "from_name", "to_name", "billsec", "disposition", "lastapp", "userfield", "faxdata", "lastdata", "cost", "organization", "channel", "dstchannel", "app", "callclass", "dest_type", "duration", "dcontext", "pbxid", "type", "timezone"}, {"id", "start", "answer", "end", "src", "dst", "from_number", "to_number", "from_name", "to_name", "billsec", "disposition", "lastapp", "userfield", "faxdata", "lastdata", "cost", "organization", "channel", "dstchannel", "app", "callclass", "dest_type", "duration", "dcontext", "pbxid", "type", "timezone"})
in
#"Expanded Column1"
@jdchipps , refer if this can help
https://datachant.com/2016/06/27/cursor-based-pagination-power-query/
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 39 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 142 | |
| 111 | |
| 65 | |
| 38 | |
| 33 |