Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Helper I
Helper I

Set custom filter values as 'blank' or null


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 constraint"



custom visual code

var customFilter={
$schema: "",
target: {
table: filters[1].target.table,
column: filters[1].target.column
operator: filters[1].operator ,

Currently we have requirement such that we have allready existing filter in report and we want merge new custom filter in existing filter. Existing filter value is null  for operator 'is not blank' so whenever we apply existing and new custom filter it will throws value invalid error.


So which value pass in custom filter so it will display as (Blank) in filter panel?

Thanks in Advance.


Frequent Visitor

You can do this by using an advanced filter with the IsBlank operator:


new pbi.models.AdvancedFilter(
{ table, column }, "And", { operator: "IsBlank", value: "" }


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.

Helper I
Helper I

Hi RubenCruz,


we have not found  any solution.


Thanks & Regards,


Hi, we also need to able to set (Blank) in basic filters. is there any update regarding this?

We have not found any solution


Community Support
Community Support



Simply try string "(Blank)".

values: ["(Blank)"]
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

now 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.




As an alternative, add another AdvancedFilter. You could also leave a comment on GitHub.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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: "",
target: {
table: table,
column: column
operator: 'In',
values: [value]

CurrentPage.getFilters().then(function (allTargetFilters) {

at time of setFilters it will throws error becuase 

In that existing filter there is one basic filter

$schema: "",
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.



Helpful resources

Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City


Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.