<?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 Re: Filter if a Table if selected date falls between 2 date ranges in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1546788#M30562</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="110956" data-lia-user-login="MattScruggs" class="lia-mention lia-mention-user"&gt;MattScruggs&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm posting here as well the response discussed by PM&lt;/P&gt;
&lt;P&gt;I filtered out the blanks on build date (visual filter).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The updated, simplified code for the measure is:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Show measure V3 = 
VAR minPeriod_ = MIN ( Calendar[Date] )
VAR maxPeriod_ = MAX ( Calendar[Date] )
VAR currentStart_ = CALCULATE( SELECTEDVALUE ( Table1[ActualBuildDate] ), ALL('Calendar'))
VAR currentEnd_ = CALCULATE( SELECTEDVALUE ( Table1[ActualDismantleDate]), ALL('Calendar'))
RETURN
    IF (
        NOT (
            currentStart_ &amp;gt; maxPeriod_
                || ( currentEnd_ &amp;lt; minPeriod_ &amp;amp;&amp;amp; NOT ISBLANK ( currentEnd_ ) )
        ),
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;1.&lt;/STRONG&gt; If you place this measure &lt;STRONG&gt;in the table visual &lt;/STRONG&gt;it should work. Do check that the results are as expected. However, you need to keep the measure in the visual. See it on page SCAFF.Monthly (2)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. &lt;/STRONG&gt;However, taking the measure off the visual and placing it as visual filter as we had done earlier will not work because of the Calendar columns you are using in the slicer. In this case the rows shown will be the ones shown in point 1 &lt;STRONG&gt;except&lt;/STRONG&gt; those for which ActualBuildDate falls outside the selected period in the slicers. This is because of the relationship between Calendar[Date] and Table1[ActualDismantleDate]&amp;nbsp;See it on page SCAFF.Monthly (3)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if the solution on SCAFF.Monthly (2) is not good enough and you want the measure outside the visual, you have 2 options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a) Delete (or deactivate) the Calendar[Date] and Table1[ActualDismantleDate] relationship.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; b) Build an auxiliary date table that you'll use for the slicers and won't interfere with the visual. In this case the measure above will need to be adapted a bit&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Dec 2020 16:43:46 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-12-12T16:43:46Z</dc:date>
    <item>
      <title>Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539029#M30260</link>
      <description>&lt;P&gt;I have the following set up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tag&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Start Date&amp;nbsp; &amp;nbsp; &amp;nbsp;End Date&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;12/31/2009&lt;/TD&gt;&lt;TD&gt;1/21/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1235&lt;/TD&gt;&lt;TD&gt;3/8/2019&lt;/TD&gt;&lt;TD&gt;3/10/2019&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1236&lt;/TD&gt;&lt;TD&gt;1/30/2019&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1237&lt;/TD&gt;&lt;TD&gt;5/18/2008&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1238&lt;/TD&gt;&lt;TD&gt;4/3/2020&lt;/TD&gt;&lt;TD&gt;10/5/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1239&lt;/TD&gt;&lt;TD&gt;12/3/2018&lt;/TD&gt;&lt;TD&gt;12/6/2018&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to create a set of filters for Month, Quarter, and Year that filter and show anything that was standing within this time frame.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the filters are set to January, 2020, Then 1234,1236,1237, and 1238 should show.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the filters are set to May, 2020, Then 1236, 1237, and 1238 should show.&lt;/P&gt;&lt;P&gt;If the filters are set to Q4, 2020, Then&amp;nbsp;1236, 1237, and 1238 should show.&lt;/P&gt;&lt;P&gt;If the filters are set to December, 2019 Then 1234,1235,1236, and 1237 should show.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have had quite a bit of trouble getting this to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a calender table with the following formula&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calendar = CALENDAR(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN(Maintable[Start Date]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX(MainTable[Start Date]) &amp;gt; MAX(MainTable[End Date]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX(MainTable[Start Date]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX(MainTable[End Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I want to use this calender table for the filters.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 15:54:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539029#M30260</guid>
      <dc:creator>MattScruggs</dc:creator>
      <dc:date>2020-12-08T15:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539220#M30264</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="110956" data-lia-user-login="MattScruggs" class="lia-mention lia-mention-user"&gt;MattScruggs&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First off, make sure you create a well-formed calendar table, with &lt;STRONG&gt;full years&lt;/STRONG&gt; or you might have problems with time intelligence down the line. You can create a measure and apply it as filter to the table visual:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Show measure =
VAR minPeriod_ =
    MIN ( CalendarT[Date] )
VAR maxPeriod_ =
    MAX ( CalendarT[Date] )
VAR currentStart_ =
    SELECTEDVALUE ( Table1[Start Date] )
VAR currentEnd_ =
    SELECTEDVALUE ( Table1[End Date] )
RETURN
    IF (
        COUNTROWS (
            INTERSECT (
                GENERATESERIES ( minPeriod_, maxPeriod_ ),
                GENERATESERIES ( currentStart_, currentEnd_ )
            )
        ) &amp;gt; 0,
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Set the measure as a visual filter and&amp;nbsp; choose to Show when value is 1. I am assuming here that you have the table visual as shown above (with&amp;nbsp;those 3 columns). In that, applying the measure as filter will result in the table showing the rows that have one day within the period selected in the slicers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 17:51:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539220#M30264</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-08T17:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539423#M30281</link>
      <description>&lt;P&gt;It is giving me an error, staying that GENERATESERIES cannot be blank. The End dates have the potential to be blank. Could this be causing the error?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 21:41:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539423#M30281</guid>
      <dc:creator>MattScruggs</dc:creator>
      <dc:date>2020-12-08T21:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539435#M30283</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="110956" data-lia-user-login="MattScruggs" class="lia-mention lia-mention-user"&gt;MattScruggs&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yeah, it's because of the SELECTEDVALUE() at the total&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Show measure =
VAR minPeriod_ =
    MIN ( CalendarT[Date] )
VAR maxPeriod_ =
    MAX ( CalendarT[Date] )
VAR currentStart_ =
    SELECTEDVALUE ( Table1[Start Date], 0 )
VAR currentEnd_ =
    SELECTEDVALUE ( Table1[End Date], -1 )
RETURN
    IF (
        COUNTROWS (
            INTERSECT (
                GENERATESERIES ( minPeriod_, maxPeriod_ ),
                GENERATESERIES ( currentStart_, currentEnd_ )
            )
        ) &amp;gt; 0,
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 21:53:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1539435#M30283</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-08T21:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1542853#M30401</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Show measure = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR minPeriod_ =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN ( Calendar[Date] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR maxPeriod_ =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX ( Calendar[Date] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR currentStart_ =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE ( '1_Overview'[ActualBuildDate], 0 )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR currentEnd_ =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE ( '1_Overview'[ActualDismantleDate], -1 )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;INTERSECT (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;GENERATESERIES ( minPeriod_, maxPeriod_ ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;GENERATESERIES ( currentStart_, currentEnd_ )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;) &amp;gt; 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is the formula as I have it typed in exactly. I cant seem to pin down the issue. Its still saying Generateseries cant be blank.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Dec 2020 10:29:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1542853#M30401</guid>
      <dc:creator>MattScruggs</dc:creator>
      <dc:date>2020-12-10T10:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1543001#M30406</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="110956" data-lia-user-login="MattScruggs" class="lia-mention lia-mention-user"&gt;MattScruggs&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not work, I'd need the pbix (or a mock that reproduces the issue). It owuld have been quicker to do it the "traditional" way, just checking the dates boundaries&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Show measure =
VAR minPeriod_ =
    MIN ( CalendarT[Date] )
VAR maxPeriod_ =
    MAX ( CalendarT[Date] )
VAR currentStart_ =
    SELECTEDVALUE ( Table1[Start Date] )
VAR currentEnd_ =
    VAR aux_ =
        SELECTEDVALUE ( Table1[EndDate], 0 )
    RETURN
        IF ( NOT ISBLANK ( aux_ ), aux_, maxPeriod_ )
RETURN
    IF (
        ISFILTERED ( Table1[Tag] ),
        IF (
            COUNTROWS (
                INTERSECT (
                    GENERATESERIES ( minPeriod_, maxPeriod_ ),
                    GENERATESERIES ( currentStart_, currentEnd_ )
                )
            ) &amp;gt; 0,
            1,
            0
        ),
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:15:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1543001#M30406</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-10T11:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1543024#M30408</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="110956" data-lia-user-login="MattScruggs" class="lia-mention lia-mention-user"&gt;MattScruggs&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I meant this alternative:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Show measure =
VAR minPeriod_ =
    MIN ( CalendarT[Date] )
VAR maxPeriod_ =
    MAX ( CalendarT[Date] )
VAR currentStart_ =
    SELECTEDVALUE ( Table1[Start Date] )
VAR currentEnd_ =
    SELECTEDVALUE ( Table1[EndDate] )
RETURN
    IF (
        NOT (
            currentStart_ &amp;gt; maxPeriod_
                || ( currentEnd_ &amp;lt; maxPeriod_ &amp;amp;&amp;amp; NOT ISBLANK ( currentEnd_ ) )
        ),
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:29:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1543024#M30408</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-10T11:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filter if a Table if selected date falls between 2 date ranges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1546788#M30562</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="110956" data-lia-user-login="MattScruggs" class="lia-mention lia-mention-user"&gt;MattScruggs&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm posting here as well the response discussed by PM&lt;/P&gt;
&lt;P&gt;I filtered out the blanks on build date (visual filter).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The updated, simplified code for the measure is:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Show measure V3 = 
VAR minPeriod_ = MIN ( Calendar[Date] )
VAR maxPeriod_ = MAX ( Calendar[Date] )
VAR currentStart_ = CALCULATE( SELECTEDVALUE ( Table1[ActualBuildDate] ), ALL('Calendar'))
VAR currentEnd_ = CALCULATE( SELECTEDVALUE ( Table1[ActualDismantleDate]), ALL('Calendar'))
RETURN
    IF (
        NOT (
            currentStart_ &amp;gt; maxPeriod_
                || ( currentEnd_ &amp;lt; minPeriod_ &amp;amp;&amp;amp; NOT ISBLANK ( currentEnd_ ) )
        ),
        1,
        0
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;1.&lt;/STRONG&gt; If you place this measure &lt;STRONG&gt;in the table visual &lt;/STRONG&gt;it should work. Do check that the results are as expected. However, you need to keep the measure in the visual. See it on page SCAFF.Monthly (2)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. &lt;/STRONG&gt;However, taking the measure off the visual and placing it as visual filter as we had done earlier will not work because of the Calendar columns you are using in the slicer. In this case the rows shown will be the ones shown in point 1 &lt;STRONG&gt;except&lt;/STRONG&gt; those for which ActualBuildDate falls outside the selected period in the slicers. This is because of the relationship between Calendar[Date] and Table1[ActualDismantleDate]&amp;nbsp;See it on page SCAFF.Monthly (3)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if the solution on SCAFF.Monthly (2) is not good enough and you want the measure outside the visual, you have 2 options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; a) Delete (or deactivate) the Calendar[Date] and Table1[ActualDismantleDate] relationship.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; b) Build an auxiliary date table that you'll use for the slicers and won't interfere with the visual. In this case the measure above will need to be adapted a bit&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 16:43:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-if-a-Table-if-selected-date-falls-between-2-date-ranges/m-p/1546788#M30562</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-12T16:43:46Z</dc:date>
    </item>
  </channel>
</rss>

