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
cmw
New Member

Trying to use filter parameter with C# PowerBI V2 API GetGroupsAsync()

I'm trying to select a PowerBI Embedded Group using the $filter parameter with GetGroupsAsync()

Currently I am using Microsoft Power BI Version 2 APIs with C#

This is the method I'm trying to use:

public static System.Threading.Tasks.Task<Microsoft.PowerBI.Api.V2.Models.ODataResponseListGroup> GetGroupsAsync (this Microsoft.PowerBI.Api.V2.IGroups operations, string filter = null, Nullable<int> top = null, Nullable<int> skip = null, System.Threading.CancellationToken cancellationToken = null);

I can retrieve all the Power BI Groups using the below line, so I am confident the rest of my code is functioning

var groups = await client.Groups.GetGroupsAsync();

But how does this $filter parameter need to be formatted to retrieve only one?

I found some Power BI API Version: v1.0 REST documentation

https://docs.microsoft.com/en-us/rest/api/power-bi/groups/getgroups

I just need to match the Group Id GUID in the $filter, I tried the line below with no success

var groups = await client.Groups.GetGroupsAsync($"id eq '{workspaceId.ToString()}'");

Has anyone been able to get this $filter parameter working with the Power BI Version 2 APIs and C#?

I would prefer not to resort to retrieving all the Groups and filtering within C# if the GetGroupsAsync() $filter parameter is available.

1 REPLY 1
yvcabrera
New Member

sample :

//list workspaces
var workspaces = await pbiClient.Groups.GetGroupsAsAdminAsync(top: 100, null, "type eq 'Workspace' and state eq 'Active'");

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.