Forum Discussion
pankajsonkul
9 years agoHelper I
Set custom filter values as 'blank' or null
Hi, How to set value as blank to custom filter. Following code which will create custom filter for blank value as null but it throws following error "values.0 is invalid. Not meeting type c...
dearwicker
7 years agoFrequent Visitor
You can do this by using an advanced filter with the IsBlank operator:
new pbi.models.AdvancedFilter(
{ table, column }, "And", { operator: "IsBlank", value: "" }
).toJSON()
The empty string for value shouldn't be necessary (after all, we are just checking if the column is blank, not comparing it with a value. But I get error messages if 'value' is omitted.
The "And" operator is only there because of the perculiar way filters are composed: the above snippet is combining a list of operators which happens to only have one item in the list, so it won't actually use the And.