Forum Discussion
Anonymous
7 years agoNot applicable
Javascript api
HI I am a web developer new to PowerBI. The team I am in looks after the company CRM which includes financial and analytics data. We are starting to use PowerBI to embed reports in our pages. Acr...
- 7 years ago
Yes, you can set filters uisng JavaScript and your kendo UI controls. Begin by embedding a report by calling powerbi.embed and holding on to the reference to the report object.
var config = { type: 'report', id: embedReportId, embedUrl: embedUrl, accessToken: accessToken, tokenType: models.TokenType.Embed }; // Get a reference to the embedded report HTML element var embedContainer = document.getElementById('embedContainer'); // Embed the report and display it within the div container. var report = powerbi.embed(embedContainer, config);After that, you can set a filter on the embedded report by calling report.setFilters.
let states = ["FL","GA","NC"] const basicStateFilter = { $schema: "http://powerbi.com/product/schema#basic", target: { table: "Customers", column: "State" }, operator: "In", values: states } // apply filter to report report.setFilters([basicStateFilter]);
v-jiascu-msft
Microsoft Employee
7 years ago