<?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 a slicer and filtering if the Number is between two numbers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2320708#M57962</link>
    <description>&lt;P&gt;I have a data table with a Start Year Column and End year Column I want to be able to Create a slicer that when I select a year it finds all rows between or equal to the start year and below or equal to the end year. Im not sure if creating a seperate key table with the years that I would be able to select from and linking it by some comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year Comp 2 is just a seperate Table with possible years I would like to be able to slice by.&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Table 2&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Feb 2022 21:47:39 GMT</pubDate>
    <dc:creator>Zfilter</dc:creator>
    <dc:date>2022-02-04T21:47:39Z</dc:date>
    <item>
      <title>Using a slicer and filtering if the Number is between two numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2320708#M57962</link>
      <description>&lt;P&gt;I have a data table with a Start Year Column and End year Column I want to be able to Create a slicer that when I select a year it finds all rows between or equal to the start year and below or equal to the end year. Im not sure if creating a seperate key table with the years that I would be able to select from and linking it by some comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year Comp 2 is just a seperate Table with possible years I would like to be able to slice by.&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Table 2&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 21:47:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2320708#M57962</guid>
      <dc:creator>Zfilter</dc:creator>
      <dc:date>2022-02-04T21:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using a slicer and filtering if the Number is between two numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2321335#M57991</link>
      <description>&lt;P&gt;Feed your slicer from 'Table 2'[Year Comp 2]&amp;nbsp; (keep that table disconnected from your data model) . Create a measure that implements your logic against SELECTEDVALUE('Table 2'[Year Comp 2]).&amp;nbsp; Then add that measure to the page level filters.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Feb 2022 20:58:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2321335#M57991</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-02-05T20:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using a slicer and filtering if the Number is between two numbers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2326917#M58301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="357111" data-lia-user-login="Zfilter" class="lia-mention lia-mention-user"&gt;Zfilter&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has your problem been solved? If it is solved, please mark a reply which is helpful to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem is still not resolved,&amp;nbsp;please try the following measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR yearcomp =
    SELECTEDVALUE ( 'Table 2'[Year Comp 2] )
RETURN
    IF (
        yearcomp = BLANK (),
        1,
        COUNTROWS (
            FILTER (
                'Table 1',
                'Table 1'[StartYear] &amp;lt;= yearcomp
                    &amp;amp;&amp;amp; 'Table 1'[EndYear] &amp;gt;= yearcomp
            )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Then&amp;nbsp;in the &lt;STRONG&gt;visual-level&lt;/STRONG&gt; filter, show items when the Measure is 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Winniz&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 07:23:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-slicer-and-filtering-if-the-Number-is-between-two/m-p/2326917#M58301</guid>
      <dc:creator>v-kkf-msft</dc:creator>
      <dc:date>2022-02-16T07:23:42Z</dc:date>
    </item>
  </channel>
</rss>

