<?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 Using SWITCH to filter table and show all if no filter is applied in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SWITCH-to-filter-table-and-show-all-if-no-filter-is/m-p/2211848#M52207</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to write a measure to use as a filter on a table/matrix visual. The purpose of the filter is to filter the visual, if i have selected a value in another visual. But if i have nothing selected i want to show all the item_no where the "post_month_year (sale)" is blank.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the measure i have so far:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;test2 = 
SWITCH (
    TRUE (),
    VALUES ( Vareposter_combined[Post_month_year (purchase)] )
        = MAX ( 'Post_month_year (Purchase)'[Post_month_year (purchase)] )
        &amp;amp;&amp;amp; VALUES ( Vareposter_combined[Post_month_Year (sale)] )
            &amp;gt;= MAX ( 'Post_month_year (Sale)'[Post_month_Year (sale)] ), 1,
    ISBLANK ( VALUES ( Vareposter_combined[Post_month_year (sale)] ) ), 1,
    NOT ( ISFILTERED ( Vareposter_combined[Post_month_year (purchase)] ) ), 1,
    0
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the measure like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 12:11:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-29T12:11:32Z</dc:date>
    <item>
      <title>Using SWITCH to filter table and show all if no filter is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SWITCH-to-filter-table-and-show-all-if-no-filter-is/m-p/2211848#M52207</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to write a measure to use as a filter on a table/matrix visual. The purpose of the filter is to filter the visual, if i have selected a value in another visual. But if i have nothing selected i want to show all the item_no where the "post_month_year (sale)" is blank.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the measure i have so far:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;test2 = 
SWITCH (
    TRUE (),
    VALUES ( Vareposter_combined[Post_month_year (purchase)] )
        = MAX ( 'Post_month_year (Purchase)'[Post_month_year (purchase)] )
        &amp;amp;&amp;amp; VALUES ( Vareposter_combined[Post_month_Year (sale)] )
            &amp;gt;= MAX ( 'Post_month_year (Sale)'[Post_month_Year (sale)] ), 1,
    ISBLANK ( VALUES ( Vareposter_combined[Post_month_year (sale)] ) ), 1,
    NOT ( ISFILTERED ( Vareposter_combined[Post_month_year (purchase)] ) ), 1,
    0
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the measure like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 12:11:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SWITCH-to-filter-table-and-show-all-if-no-filter-is/m-p/2211848#M52207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T12:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using SWITCH to filter table and show all if no filter is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SWITCH-to-filter-table-and-show-all-if-no-filter-is/m-p/2217433#M52520</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure what's your data. Based on your description,&amp;nbsp;you can create a measure returns 1 when you select a value in another visual, else if you have nothing selected, then it shows all item_no where the "post_month_year (sale)" is blank.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need more help, could you provide&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;(1) a sample file, you can replace raw data with bogus data to protect your privacy,&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;(2) or provide some samp data involved in the measure&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;(3) give your expected result based on the sample you provide&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Tang&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 06:20:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-SWITCH-to-filter-table-and-show-all-if-no-filter-is/m-p/2217433#M52520</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2021-12-02T06:20:16Z</dc:date>
    </item>
  </channel>
</rss>

