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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
crturner
Microsoft Employee
Microsoft Employee

Using Power BI Rest APIs with Filters in Powershell

I am attempting to call the Get Groups REST API in Powershell to obtain a list of all the workspaces I have access to. 

 

$GetWorkspaces = Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups/" -Method Get 

 

I would like to add a filter on the workspace name, i.e., only return workspaces that include that word "email" in them. I've used the try it function, and tried to edit the url string, but nothing seems to change the result set from returning every workspace. Appreciate any thoughts!

1 ACCEPTED SOLUTION

The Try it now feature is great, and I've been testing it, but I was getting syntax errors.

If anyone else is struggling with this, set the name/value as $filter/contains(name,'text')

View solution in original post

5 REPLIES 5
GilbertQ
Super User
Super User

Hi @crturner 

 

I would try and use the Try it now in the PBI Service to see what works, what does not work?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

The Try it now feature is great, and I've been testing it, but I was getting syntax errors.

If anyone else is struggling with this, set the name/value as $filter/contains(name,'text')

GilbertQ
Super User
Super User

Hi @crturner 

 

Here is an example with the API where you can apply the filter

 

Groups - Get Groups - REST API (Power BI Power BI REST APIs) | Microsoft Learn





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ I've seen that example and tried it

$GetWorkspaces = Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups?$filter=contains(name,'email')" -Method Get

But I still get the entire result set back

Do you have any error while running it? give me infos. thanks!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.