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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.