Hello All,
Greetings, I had been created an Alert Data report with two parameters such as Start Date and End Date, the scenario of the report is that the user will first select the Start Date and End Date, and according to that date range the report will be displayed for that particular data. The report was working fine and I had published it to the Power BI Service too and there also the parameters are perfectly working.
I had embedded that report into an Asp.Net MVC application using one of the Power BI developer samples [App Owns Data] in GitHub. The report had been embedded and working fine. The issue is, the parameters are not working in the Power BI Embedded. In the web app I had created 2 list boxes for the Start Date and End Date and a button, the report will be displayed once the user selects the dates from the list boxes and clicks the button. I have used the javascript to set the filters for the parameters but the filters are not reflected in the report.
Requesting for a solution or suggestion to accomplish this scenario. I have attached the code for reference.
const filter1 = { $schema: "http://powerbi.com/product/schema#advanced", target: { table: "Alert", column: "Date" }, logicalOperator: "And", conditions: [ { operator: "GreaterThanOrEqual", value: sd }, { operator: "LessThanOrEqual", value: ed } ], }; var reportContainer = $('#reportContainer')[0]; var report = powerbi.embed(reportContainer, config); //report.on('loaded', event => { report.getFilters().then(filters => { filters.push(filter1); return report.setFilters(filters); }) }); report.setFilters([filter1]);