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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
russell80
Helper III
Helper III

Embed Report in SharePoint and Dynamically Filter based on SharePoint Site

Hi, I have a SharePoint site to manage projects, each time a new project is started, a new site is created for the project based off a template. In the new project site, I want to embed a power BI report (as part of the template) to show data for that project (the report currently holds data for all projects but can easilly be filterted). I can get as far as embedding the report in the site, and using the Power BI Developer Sandbox, I can set a report filter using a predefined filter value for the project code like below. But where I have gotten stuck is I want to be able to pass the project code from the SharePoint site and use it as the value in the filter. Not sure it's even possible though.

const basicFilter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "Projects",
column: "Project Code"
},
operator: "In",
values: ["123456"],
filterType: models.FilterType.BasicFilter,
requireSingleSelection: true
}

await report.updateFilters(models.FiltersOperations.Add, [basicFilter]);

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @russell80 ,

 

The Get a site resource API Could retrieve properties and relationships for a site resource. A site resource represents a team site in SharePoint.

Please check if this API could help you.

 

For more details, please refer to:

Get a SharePoint Site - Microsoft Graph v1.0 | Microsoft Learn

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @russell80 ,

 

The Get a site resource API Could retrieve properties and relationships for a site resource. A site resource represents a team site in SharePoint.

Please check if this API could help you.

 

For more details, please refer to:

Get a SharePoint Site - Microsoft Graph v1.0 | Microsoft Learn

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.