Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
Hello,
I am finding difficulty in applying the filter through embed javascript api.
I have two companies, i.e. 'abc' and 'xyz', I want to apply filter on companyname with 'abc'.
I tried below code but it does not apply filter, can anybody help !!!
Thanks in advance........
var filterTypeTarget={}; var operatorAndValues={}; filterTypeTarget.table = 'companytable'; filterTypeTarget.column = 'ComapnyName'; operatorAndValues.type='basic'; operatorAndValues.operator = 'In'; operatorAndValues.values = ['abc','xyz']; values = ['abc']; $(function () { var models = window['powerbi-client'].models; var defaultFilter = new models.BasicFilter(filterTypeTarget, operatorAndValues, values); console.log(defaultFilter.toJSON()); var report; var embedConfiguration = { type: 'report', filter: defaultFilter.toJSON(), . . . . embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed' }; var $reportContainer = $('#reportContainer'); report = powerbi.embed($reportContainer.get(0), embedConfiguration); })
Is this the Power BI javascript api?
Yes it is..........
@abhi123: Is Javascript api works with Rest API?
We have integrated our reports in an external application using Rest API(Not Power BI Embedded azure) so we want to customize integration process using Javascript API.
Hi Sunkari
I have used Azure powerbi embedded.
Can u please tell me the process of extrenal web api for the same(Without Azure)?.........
Thanks.
Abhi
@abhi123: Please go through the following link so that you will get some context about POWER BI Rest API
https://msdn.microsoft.com/en-us/library/dn877544.aspx
Note: Power BI rest API only supports single filter with single value.
Hi @Sunkari
Thank you so much for the same will go threw with that and will let you know.
Thanks
Abhi.
hi @Sunkari
Can you please provide one running demo on powerbi javascript api if possible?......really stuck on this.....!!
If you can then please.
Thanks
Abhi.
No issues.
Thanks
Abhi.
In your embedConfiguration, is "filter" or "filters" (with an 's')?
Per the documentation, I believe it is filters.
Also, it should be an array i.e., filters: [ defaultFilter.toJSON() ]
Please give it a try and let me know because I too am having issues setting the filters in the embeddedConfiguration. I get the following errors in the console
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |