This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello everyone,
I am trying to set the filters on the visual while embedding it.
I am getting the following error.
Is there any workaround for this?
The embed code:
const filter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: "Manufacturer",
column: "Sample Data"
},
operator: "In",
values: ["Abbas"]
};
var config = {
type: 'visual',
accessToken: accessTokenToUse,
embedUrl: embedURLToUse,
reportId: reportIdToUse,
pageName: pageNameToUse,
visualName: visualNameToUse
};
var dashboard = powerbi.embed(visualDiv, config);
dashboard.setFilters([filter]); Solved! Go to Solution.
Hi @Anonymous,
I'm afraid setting filters while embedding visuals isn't available for now. Please refer to the source code of Powerbi.js. I would suggest you create an idea here.
Best Regards,
Dale
Hi
Recently I have come across that problem as well
Just found a solution. It is to change object <filters> and call method <reload> of Visual.
/**
* Reloads embed using existing configuration.
* E.g. For reports this effectively clears all filters and makes the first page active which simulates resetting a report back to loaded state.
*
* ```javascript
* report.reload();
* ```
*/
reload(): Promise<void>;
For example
const pbiService = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory);
const embeddedObj = <pbi.Visual>(pbiService.embed(embedContainer, embedObj.config as {}));
// will update visual using new filters from newFiltersArr after 10 seconds
setTimeout(() => {
(embeddedObj.config as any).filters = newFiltersArr;
embeddedObj.reload();
}, 10000);
Hi @Anonymous,
I'm afraid setting filters while embedding visuals isn't available for now. Please refer to the source code of Powerbi.js. I would suggest you create an idea here.
Best Regards,
Dale
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |