cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MHald
Regular Visitor

Power BI REST API for Capacities - Syntax for $filter with nested json

I am trying to filter the admin capatities api for the nested status of the last refresh, but am having trouble with the syntax for the api call. Here is an example of a call that doesn't work.  I have tried many different delimeters with no success.  I have provided an example of the response below.  The short question:  How do I filter on just the lastRefresh status?

 

refreshables_url = "https://api.powerbi.com/v1.0/myorg/admin/capacities/refreshables?$filter=lastRefresh/status eq Failed

 

The below documentation only shows a filtering example at the top level.

https://docs.microsoft.com/en-us/rest/api/power-bi/admin/get-refreshables#code-try-0

RefreshablesAPI.jpg

2 REPLIES 2
MHald
Regular Visitor

Thanks for post!  I have used the dataset API before and then looped through the output in my PowerShell.  I was hoping the Capacity Refresh API allowed me to do this within a single call, using the nested json output in the $filter.  My alternative using this API is to pull back a day's worth of refreshes into an object variable and drill down to the status within PowerShell.  Thought I wouldn't have to do that, but maybe the code behind the API doesn't allow to filter on anything nested in the response.  It would just be good to know this in their documentation so I am not wasting my time trying to figure it out.

v-yalanwu-msft
Community Support
Community Support

Hi, @MHald ;

You can check if these related post can is useful to you.

https://community.powerbi.com/t5/Developer/API-Get-Last-Refresh-of-all-reports-of-a-workspace/m-p/39...

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors