This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi
I have managed to retrieve the data from this Graph API request
GET https://graph.microsoft.com/v1.0/users
i got the data but they are not complete at all, i have only one third of my data.
could you please tell me how to get the comprehensive data?
thanks
Solved! Go to Solution.
Hi, @Anonymous
This is happening because Graph API from MS returns paginated results. So, to retrieve all pages from the result, you can try M code in PQ
for example,
let
GetAllPages = (url as text) as list =>
let
Source = Json.Document(Web.Contents(url)),
data = Source[value],
next = try Source[@odata.nextLink] otherwise null,
output = if next is null then data else List.Combine({data, @GetAllPages(next)})
in
output,
InitialUrl = "https://graph.microsoft.com/v1.0/users",
Data = GetAllPages(InitialUrl)
in
Data
Note: Power BI's Power Query component has a limit to the number of recursions it can perform, so if you have a very large number of pages, you may need to adjust the recursion limit in the options.
You would also need to include an 'Authorization' header with your access token in the Web.Contents function, and you'll need to handle any rate limits or other API constraints from the Graph API. As this example stands, it's a very basic example and would need to be expanded to handle a production use case.
Proud to be a Super User!
Hi, @Anonymous
This is happening because Graph API from MS returns paginated results. So, to retrieve all pages from the result, you can try M code in PQ
for example,
let
GetAllPages = (url as text) as list =>
let
Source = Json.Document(Web.Contents(url)),
data = Source[value],
next = try Source[@odata.nextLink] otherwise null,
output = if next is null then data else List.Combine({data, @GetAllPages(next)})
in
output,
InitialUrl = "https://graph.microsoft.com/v1.0/users",
Data = GetAllPages(InitialUrl)
in
Data
Note: Power BI's Power Query component has a limit to the number of recursions it can perform, so if you have a very large number of pages, you may need to adjust the recursion limit in the options.
You would also need to include an 'Authorization' header with your access token in the Web.Contents function, and you'll need to handle any rate limits or other API constraints from the Graph API. As this example stands, it's a very basic example and would need to be expanded to handle a production use case.
Proud to be a Super User!
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.