<?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 Out Rows Given List of Values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849729#M91303</link>
    <description>&lt;P&gt;Screenshot of filter pane ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Screenshot of data ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What does that tell us?&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 18:37:48 GMT</pubDate>
    <dc:creator>quintinh</dc:creator>
    <dc:date>2022-10-18T18:37:48Z</dc:date>
    <item>
      <title>Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849377#M91266</link>
      <description>&lt;P&gt;Background: We're a trucking company. Driver retention is a big issue for us so, I'm creating some retention analytics for the company to use. I'm working on a count of active drivers given a time context. With the help of some online research, I have the count almost working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem: There is a termination code in our 'Drivers' file. A subset of those codes are for drivers that did not make it out of orientation and, therefore, are never counted as an active driver. I can't remove them at the Power Query level as I need them for other retention related analytics. I need to eliminate them with DAX. I'm trying to add that to the 'Driver Count' measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mr. Googlepants tells me I should be able to use 'NOT' with 'IN' to make this happen. I've yet to be successful with a variety solution examples. This is my latest permutation ...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Driver Count = 
CALCULATE (
    COUNTROWS ( Drivers ),
    FILTER (
        VALUES ( 'Drivers'[Hire Date] ),
        'Drivers'[Hire Date] &amp;lt;= MAX ( Dates[Date] )
    ),
    FILTER (
        VALUES ( 'Drivers'[Termination Date] ),
        OR(
            Drivers[Termination Date] &amp;gt;= MIN ( Dates[Date] ),
            ISBLANK ('Drivers'[Termination Date] )
        )
    ),
        FILTER(
        'Drivers',
        NOT 'Drivers'[Termination Code] IN {"LEFTOR","FAILIN","FAILRT","FAILWR","STLEFT","STFLRT","STFLIN","NEVER"}
    )
)&lt;/LI-CODE&gt;&lt;P&gt;The third filter statement is where I'm having trouble ...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        FILTER(
        'Drivers',
        NOT 'Drivers'[Termination Code] IN {"LEFTOR","FAILIN","FAILRT","FAILWR","STLEFT","STFLRT","STFLIN","NEVER"}
    )&lt;/LI-CODE&gt;&lt;P&gt;I've tried it without filter and with 'VALUES' as the others filters are done (I understand the logic but not all of the syntax of those, yet).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I see as I test the measure. Clearly, the items in the list are still present.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you wish to view the PBIX, I have created an anonomized version. The 'Driver Count' tab is where the screenshot above was taken from.&lt;/P&gt;&lt;P&gt;&lt;A href="https://jrschugel0-my.sharepoint.com/:u:/g/personal/qholmberg_jrschugel_com/EYHjSpYJmBZIqmZ0CwJ-yvYBBgWc7d3a9_yRE50CDpttjg?e=ZgBgul" target="_blank" rel="noopener"&gt;Driver Retention Anonymized&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can point me in a direction to learn what I need to do here, it would be greatly apprecieated.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 15:00:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849377#M91266</guid>
      <dc:creator>quintinh</dc:creator>
      <dc:date>2022-10-18T15:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849410#M91272</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="348247" data-lia-user-login="quintinh" class="lia-mention lia-mention-user"&gt;quintinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOT in this case shall be used as a function not as an operator therefore you need to wrap its argument with brackets&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FILTER(
        'Drivers',
        NOT 'Drivers'[Termination Code] IN {"LEFTOR","FAILIN","FAILRT","FAILWR","STLEFT","STFLRT","STFLIN","NEVER"}
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Oct 2022 15:13:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849410#M91272</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-18T15:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849618#M91284</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;... That was a previous permutation until some info from SQLBI told me I did not need them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed them so now the measure looks like ...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Driver Count = 
CALCULATE (
    COUNTROWS ( Drivers ),
    FILTER (
        VALUES ( 'Drivers'[Hire Date] ),
        'Drivers'[Hire Date] &amp;lt;= MAX ( Dates[Date] )
    ),
    FILTER (
        VALUES ( 'Drivers'[Termination Date] ),
        OR(
            Drivers[Termination Date] &amp;gt;= MIN ( Dates[Date] ),
            ISBLANK ('Drivers'[Termination Date] )
        )
    ),
    FILTER(
        'Drivers',
        NOT('Drivers'[Termination Code]) IN {"LEFTOR","FAILIN","FAILRT","FAILWR","STLEFT","STFLRT","STFLIN","NEVER"}
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Is that syntactically correct?&lt;/P&gt;&lt;P&gt;The change did not change the results ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 17:31:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849618#M91284</guid>
      <dc:creator>quintinh</dc:creator>
      <dc:date>2022-10-18T17:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849627#M91286</link>
      <description>&lt;P&gt;Thought of another permutation to try ...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    FILTER(
        'Drivers',
        NOT('Drivers'[Termination Code] IN {"LEFTOR","FAILIN","FAILRT","FAILWR","STLEFT","STFLRT","STFLIN","NEVER"})
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Still no change&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 17:34:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849627#M91286</guid>
      <dc:creator>quintinh</dc:creator>
      <dc:date>2022-10-18T17:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849689#M91300</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="348247" data-lia-user-login="quintinh" class="lia-mention lia-mention-user"&gt;quintinh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to place the measure in the filter pane of the right side table and select "is not blank " then apply the filter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:07:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849689#M91300</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-18T18:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849729#M91303</link>
      <description>&lt;P&gt;Screenshot of filter pane ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Screenshot of data ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;What does that tell us?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 18:37:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2849729#M91303</guid>
      <dc:creator>quintinh</dc:creator>
      <dc:date>2022-10-18T18:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Out Rows Given List of Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2859282#M92024</link>
      <description>&lt;P&gt;In the event anyone else runs across this, this is how I resolved my issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I never did figure out how to use NOT with IN to filter out the reason codes listed in the example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I returned to the SQL that created this data and added a Y/N column of "Activated". Any driver with one of the codes listed was never activated. I then filtered by only including those with a 'Y'.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 13:17:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Out-Rows-Given-List-of-Values/m-p/2859282#M92024</guid>
      <dc:creator>quintinh</dc:creator>
      <dc:date>2022-10-24T13:17:57Z</dc:date>
    </item>
  </channel>
</rss>

