Forum Discussion
Apply JSON Filter not working
So I have been following the steps that were outlined here https://microsoft.github.io/PowerBI-visuals/docs/concepts/filter-api/#basic-filter-api
I created a basic filter:
- Anonymous6 years ago
Yep, I've realised now thanks.
It turns out the answer was simply to use
visualhost.applyJsonFilter(advancedFilter, "general", "selfFilter", FilterAction.merge);
instead of
visualhost.applyJsonFilter(advancedFilter, "general", "Filter", FilterAction.merge);
This will filter the visual and not all the other visuals.
7 Replies
- jpppContinued Contributor
Hi Anonymous ,
this.visualHost.applyJsonFilter() pushes the filter back to Power BI so that all other visuals on the page are filtered by the content of the filter. It doesn't filter the data that the visual is getting; slicer are using the same technique.
-JP
- AnonymousNot applicable
Yep, I've realised now thanks.
It turns out the answer was simply to use
visualhost.applyJsonFilter(advancedFilter, "general", "selfFilter", FilterAction.merge);
instead of
visualhost.applyJsonFilter(advancedFilter, "general", "Filter", FilterAction.merge);
This will filter the visual and not all the other visuals.
- AnonymousNot applicable
Hello.
Can you please share your current repository project?
Right now I'm facing an issue with FilterAction.merge
host.applyJsonFilter(models.AdvancedFilter, "general", "selfFilter", FilterAction.merge);Cannot find name 'FilterAction'.Thank You.
Anonymous wrote:Yep, I've realised now thanks.
It turns out the answer was simply to use
visualhost.applyJsonFilter(advancedFilter, "general", "selfFilter", FilterAction.merge);
instead of
visualhost.applyJsonFilter(advancedFilter, "general", "Filter", FilterAction.merge);
This will filter the visual and not all the other visuals.
Anonymous wrote:Yep, I've realised now thanks.
It turns out the answer was simply to use
visualhost.applyJsonFilter(advancedFilter, "general", "selfFilter", FilterAction.merge);
instead of
visualhost.applyJsonFilter(advancedFilter, "general", "Filter", FilterAction.merge);
This will filter the visual and not all the other visuals.