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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Graph API queries for managed Devices

Hi Community!

 

to get information about managed devices we are using Graph API Queries like:

 https://graph.microsoft.com/v1.0/deviceManagement/managedDevices?$select=id,deviceCompliancePolicySt...

In Power Bi one can then expand "deviceCompliancePolicyStates" colmn and process the data. 

Now we have an request to store this data permanently in the database with the bunch of other data.  

I`ve noticed that exactly the same query didn`t return "deviceCompliancePolicyStates" data if i use it via web request ( for example in PowerShell or Graph Explorer - Microsoft Graph). I know its possible to retrieve the same data for every single device using: 

https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{deviceId}/deviceCompliancePolicySt...

but it takes quite a while to process all data. $expand don`t work as well

 

So the question is:

 

is it possible to retrieve exactly the same data from the query via web request, as they are displayed in Power BI? 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Most likely Power Query is automatically expanding the lookup fields. In Powershell you have to do that manually.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Most likely Power Query is automatically expanding the lookup fields. In Powershell you have to do that manually.

lbendlin
Super User
Super User

Are you using the Graph Security third party connector, or standard Web.Contents calls?  Have you tried ODATA instead?

Anonymous
Not applicable

Hello @lbendlin ,

 

In Power BI we are using OData.Feed and we get all data we want. The problem is, that using exactly the same query not in Power BI, but in Powershell ( via Invoke-WebrRequest) we get less attributes. So how is that possible, that the same query retrievs different data, depending on method we are using for calls? 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.