Reply
Highlighted
Member
Posts: 58
Registered: ‎11-20-2017
Accepted Solution

Power BI Embedded replace a value of one filter out of 5

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.

 


Accepted Solutions
Frequent Visitor
Posts: 4
Registered: ‎07-20-2018

Re: Power BI Embedded replace a value of one filter out of 5

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. 

View solution in original post


All Replies
Frequent Visitor
Posts: 4
Registered: ‎07-20-2018

Re: Power BI Embedded replace a value of one filter out of 5

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.