<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Set custom filter values as 'blank' or null in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/188672#M6006</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to set value as blank to custom filter.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Blank.png" style="width: 184px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/44382i0E688E138EB25DA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Blank.png" alt="Blank.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Following code which will create custom filter for blank value as null but it throws following error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"values.0 is invalid. Not meeting type constraint"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;custom visual code&lt;/P&gt;&lt;P&gt;var customFilter={&lt;BR /&gt;$schema: "&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;",&lt;BR /&gt;target: {&lt;BR /&gt;table: filters[1].target.table,&lt;BR /&gt;column: filters[1].target.column&lt;BR /&gt;},&lt;BR /&gt;operator: filters[1].operator ,&lt;BR /&gt;values:[null]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Currently we have requirement such that we have allready existing filter in report and we want merge new custom filter in existing filter. E&lt;SPAN&gt;xisting &lt;/SPAN&gt;filter value&amp;nbsp;is null &amp;nbsp;for operator 'is not blank' so whenever we apply existing and new custom filter it will throws value invalid error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So which value pass in custom filter so it will display as (Blank) in filter panel?&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2017 06:40:01 GMT</pubDate>
    <dc:creator>pankajsonkul</dc:creator>
    <dc:date>2017-06-07T06:40:01Z</dc:date>
    <item>
      <title>Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/188672#M6006</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to set value as blank to custom filter.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Blank.png" style="width: 184px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/44382i0E688E138EB25DA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Blank.png" alt="Blank.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Following code which will create custom filter for blank value as null but it throws following error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"values.0 is invalid. Not meeting type constraint"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;custom visual code&lt;/P&gt;&lt;P&gt;var customFilter={&lt;BR /&gt;$schema: "&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;",&lt;BR /&gt;target: {&lt;BR /&gt;table: filters[1].target.table,&lt;BR /&gt;column: filters[1].target.column&lt;BR /&gt;},&lt;BR /&gt;operator: filters[1].operator ,&lt;BR /&gt;values:[null]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Currently we have requirement such that we have allready existing filter in report and we want merge new custom filter in existing filter. E&lt;SPAN&gt;xisting &lt;/SPAN&gt;filter value&amp;nbsp;is null &amp;nbsp;for operator 'is not blank' so whenever we apply existing and new custom filter it will throws value invalid error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So which value pass in custom filter so it will display as (Blank) in filter panel?&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 06:40:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/188672#M6006</guid>
      <dc:creator>pankajsonkul</dc:creator>
      <dc:date>2017-06-07T06:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/189802#M6026</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/25237"&gt;@pankajsonkul&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply try string "(Blank)".&lt;/P&gt;
&lt;PRE&gt;values: ["(Blank)"]&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 14:50:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/189802#M6026</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-06-07T14:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/190416#M6045</link>
      <description>&lt;P&gt;Thanks for reply,&lt;BR /&gt;It will throws same error&lt;BR /&gt;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&lt;BR /&gt;$schema:"&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;"&lt;BR /&gt;operator:"NotIn"&lt;BR /&gt;target:"object"&lt;BR /&gt;column:"Date"&lt;BR /&gt;table:"DateRange"&lt;BR /&gt;__proto__:"object"&lt;BR /&gt;values:Array(1)&lt;BR /&gt;0:null&lt;BR /&gt;length:1&lt;/P&gt;&lt;P&gt;now whenever we add new value in this custom filter it will throws exception for null value.&lt;/P&gt;&lt;P&gt;Existing filter screen shot&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Filters.png" style="width: 206px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/44788i99757D321167D5FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Filters.png" alt="Filters.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This existing filter values in this filter we want push new filter value like'Feb 2017' it will push but due to null value &amp;nbsp;it will throws error.Actually in filter pane it will display as '(Blank)' but in code this value is null.&lt;/P&gt;&lt;P&gt;So how we can handle this null value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 11:48:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/190416#M6045</guid>
      <dc:creator>pankajsonkul</dc:creator>
      <dc:date>2017-06-08T11:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/193066#M6147</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/25237"&gt;@pankajsonkul&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an alternative, add another AdvancedFilter. You could also leave a comment on &lt;A href="https://github.com/Microsoft/PowerBI-JavaScript/issues" target="_self"&gt;GitHub&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 10:36:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/193066#M6147</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-06-13T10:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/195532#M6230</link>
      <description>&lt;P&gt;Thanks for reply,&lt;/P&gt;&lt;P&gt;You have suggest me use advance filter for handling null value but&lt;/P&gt;&lt;P&gt;Actually my implementation is like I have one custom&amp;nbsp;filter which will I want apply to existing filter(not change any existing filter).&lt;/P&gt;&lt;P&gt;So that time whenever I will try following code it will not work&lt;/P&gt;&lt;P&gt;var basicFilter = {&lt;BR /&gt;$schema: "&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;",&lt;BR /&gt;target: {&lt;BR /&gt;table: table,&lt;BR /&gt;column: column&lt;BR /&gt;},&lt;BR /&gt;operator: 'In',&lt;BR /&gt;values: [value]&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;CurrentPage.getFilters().then(function (allTargetFilters) {&lt;BR /&gt;allTargetFilters.push(basicFilter);&lt;BR /&gt;&lt;SPAN&gt;CurrentPage&lt;/SPAN&gt;.setFilters(allTargetFilters);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;at time of setFilters it will throws error becuase&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that existing filter there is one basic filter&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$schema: "&lt;A href="http://powerbi.com/product/schema#basic" target="_blank"&gt;http://powerbi.com/product/schema#basic&lt;/A&gt;",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;target: {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;table: table,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;column: column&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;operator: 'NotIn',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;values: [null]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;};&lt;/SPAN&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 08:57:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/195532#M6230</guid>
      <dc:creator>pankajsonkul</dc:creator>
      <dc:date>2017-06-16T08:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/210161#M6638</link>
      <description>&lt;P&gt;Hi RubenCruz,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have not found&amp;nbsp; any solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Pankaj&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 04:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/210161#M6638</guid>
      <dc:creator>pankajsonkul</dc:creator>
      <dc:date>2017-07-12T04:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/419466#M12512</link>
      <description>&lt;P&gt;Hi, we also need to able to set (Blank) in basic filters. is there any update regarding this?&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 08:24:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/419466#M12512</guid>
      <dc:creator>alfred1</dc:creator>
      <dc:date>2018-05-17T08:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/419505#M12515</link>
      <description>&lt;P&gt;We have not found any solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 08:44:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/419505#M12515</guid>
      <dc:creator>pankajsonkul</dc:creator>
      <dc:date>2018-05-17T08:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set custom filter values as 'blank' or null</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/653469#M18913</link>
      <description>&lt;P&gt;You can do this by using an advanced filter with the IsBlank operator:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;pbi&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;models&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AdvancedFilter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;SPAN&gt;table&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;column&lt;/SPAN&gt;&lt;SPAN&gt; }, &lt;/SPAN&gt;&lt;SPAN&gt;"And"&lt;/SPAN&gt;&lt;SPAN&gt;, { operator: &lt;/SPAN&gt;&lt;SPAN&gt;"IsBlank"&lt;/SPAN&gt;&lt;SPAN&gt;, value: &lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.toJSON&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 21:23:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Set-custom-filter-values-as-blank-or-null/m-p/653469#M18913</guid>
      <dc:creator>dearwicker</dc:creator>
      <dc:date>2019-03-25T21:23:26Z</dc:date>
    </item>
  </channel>
</rss>

