Forum Discussion
Set custom filter values as 'blank' or null
- pankajsonkul9 years agoHelper I
Thanks for reply,
It will throws same error
Following date filter,in which we have allready some date filter and 'Blank' filter whenever we read this filter values in code it will display below output
$schema:"http://powerbi.com/product/schema#basic"
operator:"NotIn"
target:"object"
column:"Date"
table:"DateRange"
__proto__:"object"
values:Array(1)
0:null
length:1now whenever we add new value in this custom filter it will throws exception for null value.
Existing filter screen shot
This existing filter values in this filter we want push new filter value like'Feb 2017' it will push but due to null value it will throws error.Actually in filter pane it will display as '(Blank)' but in code this value is null.
So how we can handle this null value.
- v-chuncz-msft9 years agoCommunity Support
As an alternative, add another AdvancedFilter. You could also leave a comment on GitHub.
- pankajsonkul9 years agoHelper I
Thanks for reply,
You have suggest me use advance filter for handling null value but
Actually my implementation is like I have one custom filter which will I want apply to existing filter(not change any existing filter).
So that time whenever I will try following code it will not work
var basicFilter = {
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: table,
column: column
},
operator: 'In',
values: [value]
};CurrentPage.getFilters().then(function (allTargetFilters) {
allTargetFilters.push(basicFilter);
CurrentPage.setFilters(allTargetFilters);
});at time of setFilters it will throws error becuase
In that existing filter there is one basic filter
{
$schema: "http://powerbi.com/product/schema#basic",
target: {
table: table,
column: column
},
operator: 'NotIn',
values: [null]
};so due to null value it will throws error,So my question is how to handle this null value such that it will not throws error.