Forum Discussion
Power BI JS not applying Visual filters correctly
Hello,
Do you have any news on this issue?
Thanks
Apologies alexmcarreira for the delay in responding, it has been a crazy few days.
I was going to try and replicate this in a solution - as I had never tested JavaScript filters against a hierarchy before.
(I am yet to get around to this).
One thing I did notice... was the use of 'ALL' inside some of the basic filters.
{
"$schema": "http://powerbi.com/product/schema#basic",
"target": {
"table": "Sales",
"measure": "Total Sales (py)"
},
"filterType": 1,
"displaySettings": {
"isHiddenInViewMode": false
},
"operator": "All",
"values": [],
"requireSingleSelection": false
}
My understanding is that this is not a valid operator for this filter type... and is probably the reason for the "Basic filter requires an operator (In | Not)" error.
If you want to default to having ALL values selected, then you should either not supply the filter definition at all... OR select "IN" with an empty array. The last time I used this, it behaved in the same was as having all options selected.
I will try and get some time to look at testing this with the hierarchy, just in case that is the cause of your original issue...
{
"$schema": "http://powerbi.com/product/schema#basic",
"target": {
"table": "Product",
"hierarchy": "Product Hierarchy",
"hierarchyLevel": "Category"
},
"filterType": 1,
"displaySettings": {
"isHiddenInViewMode": false
},
"operator": "In",
"values": [
"Mix"
],
"requireSingleSelection": false
}- Anonymous4 years agoNot applicable
Hello Matt,
Any updates regarding this issue? Have you had the chance to test this with the hierarchy?
Regards,
Rúben