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
kosmik5
Regular Visitor

Power BI Embedded Parameters and Filter

Hi,

We are developing a Power BI embedded app, where we have an Azure website containing a Power BI report, which is also uploaded to our Azure server.

I know I can set filter parameters in a Power BI app embedded in an iframe, like this:

 

function onFrameLoaded() {
var m = {
    action: "loadReport",
    reportId: reportId,
    accessToken: accessToken
};

iframe.contentWindow.postMessage(JSON.stringify(m), "*");

 

This works when you embed a Power BI report published on the web. But it doesn't work on Power BI Embedded. Is there a way to accomplish the same kind of filtering in Power BI Embedded?

 

Thank You

Hariprasad

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @kosmik5,

 

You should be able to use PowerBI-JavaScript API to set filters with Power BI Embedded. For more details, you can refer to PowerBI-JavaScript wiki FiltersSmiley Happy

const filter = { ... };

report.setFilters([filter])
  .catch(errors => {
    // Handle error
  });

Sample of filters:

const basicFilter: pbi.models.IBasicFilter = {
  $schema: "http://powerbi.com/product/schema#basic",
  target: {
    table: "Store",
    column: "Count"
  },
  operator: "In",
  values: [1,2,3,4]
}

 

Regards

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @kosmik5,

 

You should be able to use PowerBI-JavaScript API to set filters with Power BI Embedded. For more details, you can refer to PowerBI-JavaScript wiki FiltersSmiley Happy

const filter = { ... };

report.setFilters([filter])
  .catch(errors => {
    // Handle error
  });

Sample of filters:

const basicFilter: pbi.models.IBasicFilter = {
  $schema: "http://powerbi.com/product/schema#basic",
  target: {
    table: "Store",
    column: "Count"
  },
  operator: "In",
  values: [1,2,3,4]
}

 

Regards

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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