Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
thomazinh
Helper I
Helper I

API multiple call to return all data (paging)

I don't have a lot of M Query experience, and I'm working on calling all data points for an API call. In order to get where I want, I have to make 2 seperate calls above this (asking for a list of all company projects and a second asking for those project's inspections). The goal is to get all checklist itmes from those inspections.

 

How can I go through and page to get all data? My current M query looks something like this: 

 

ChecklistItems =
Table.AddColumn(
#"Filtered Rows1",
"New",
each
Json.Document(
Web.Contents(
"https://api.WEBSITE.com/rest/v1.0/",
[
RelativePath =
"projects/"
& Text.From([Project Id])
& "/checklist/list_items?filters[inspection_type_id]=98634",
Query = [
per_page = "1000"
],
Headers = [
Authorization = AuthToken
]
]
)
)
),

1 REPLY 1
ImkeF
Community Champion
Community Champion

Hello @thomazinh ,
This blogpost shows a simple paging semantics and also gives you a solution to not miss the last page when paging in Power Query: 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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.