Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
How ( and best pratice ) to get filters ( actually 5 filters report on our reports ) , remove one filter only and add the new value , or replace directly the value just for this filter ?
and keep the 4 others filter.
And the filters are of different types.
And it is possible on pagefilter ?
Thanks for your helps.
Solved! Go to Solution.
I am assuming you are talking about report level filters.
What you can do is use getFilters() to get the current filters array.
Then if you want to modify the value of the filter just modify the value within the array.
You can use the constructors to create a new filter and add in the array.
https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters#constructing-filters
Similarly you can remove the filter from the array.
Once you are done with the modifications, you can pass the updated array to the report using setFilters() function.
You can do the same for page and visual level filters too.
I am assuming you are talking about report level filters.
What you can do is use getFilters() to get the current filters array.
Then if you want to modify the value of the filter just modify the value within the array.
You can use the constructors to create a new filter and add in the array.
https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters#constructing-filters
Similarly you can remove the filter from the array.
Once you are done with the modifications, you can pass the updated array to the report using setFilters() function.
You can do the same for page and visual level filters too.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
3 | |
3 | |
2 | |
2 |
User | Count |
---|---|
15 | |
6 | |
5 | |
3 | |
3 |