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 dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am looking to build an app that passes a filter query string to a report, similar in format as the filter query string in PBI Service reports:
URL?filter=Table/Field eq 'value'
then convert this format to Javascript, IBasicFilter
const basicFilter: pbi.models.IBasicFilter = { $schema: "http://powerbi.com/product/schema#basic", target: { table: "Store", column: "Count" }, operator: "In", values: [1,2,3,4], filterType: pbi.models.FilterType.BasicFilter }
Curious if anyone has done this before, and knows of a plugin or easier way to transform this structure. thanks
Hi @sierra710,
You almost get it done. Please try the online demo here. You also can get the source code here.
// Build the filter you want to use. For more information, See Constructing // Filters in https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters. const filter = { $schema: "http://powerbi.com/product/schema#basic", target: { table: "Store", column: "Chain" }, operator: "In", values: ["Lindseys"] }; // Get a reference to the embedded report HTML element var embedContainer = $('#embedContainer')[0]; // Get a reference to the embedded report. report = powerbi.get(embedContainer); // Set the filter for the report. // Pay attention that setFilters receives an array. report.setFilters([filter]) .catch(function (errors) { Log.log(errors); });
Best Regards,
Dale
Thanks, but this does not address my question.
i am looking to programmatically generate the basic filter, not hard code values.
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 |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |