<?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 and not in filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678681#M34412</link>
    <description>&lt;P&gt;That won't work because some students are in the Activity Log and havn't requested assignment yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data example:&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Recieved Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Logout&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Recieved Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;4 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;4 - Logout&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So in this example student #4 logged in but didn't request assignment. There are other activities but I don't want to confuse you. So I really need a "NOT IN" filter.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Feb 2021 15:31:48 GMT</pubDate>
    <dc:creator>MrMike</dc:creator>
    <dc:date>2021-02-20T15:31:48Z</dc:date>
    <item>
      <title>Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678231#M34388</link>
      <description>&lt;P&gt;What is the DAX synax to count how many students requested but didn't supply the essay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this but I know its is wrong.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Students Missing Essay = CALCULATE(DISTINCTCOUNT(ACTIVITY_LOG[STUDENT_ID]), ACTIVITY_LOG[ACTIVITY_DESCRIPTION] = "Requested Assignment" &amp;amp;&amp;amp; ACTIVITY_LOG[STUDENT_ID] NOT IN LIST(ACTIVITY_LOG[STUDENT_ID], ACTIVITY_LOG[ACTIVITY_DESCRIPTION] = "No Essay"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;For example the data would be like this&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Student ID - Activity Description&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then my measure would return 2, because 2 of the 3 students requested but didn't have essay.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Feb 2021 21:59:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678231#M34388</guid>
      <dc:creator>MrMike</dc:creator>
      <dc:date>2021-02-19T21:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678239#M34389</link>
      <description>&lt;P&gt;I forgot there is a 3 activity. "Recieved Essay" so I want to also filter out students who at first had no essay then later sent in assay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data example:&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Recieved Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Recieved Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So in this example the measure would return 1 because 2 out of the 3 students eventually send in an essay.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 19 Feb 2021 22:04:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678239#M34389</guid>
      <dc:creator>MrMike</dc:creator>
      <dc:date>2021-02-19T22:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678242#M34392</link>
      <description>&lt;P&gt;How about taking the total number of students and subtracting the ones that have a "Received Essay" status?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Students Missing Essay =
DISTINCTCOUNT ( ACTIVITY_LOG[STUDENT_ID] )
    - CALCULATE (
        DISTINCTCOUNT ( ACTIVITY_LOG[STUDENT_ID] ),
        ACTIVITY_LOG[ACTIVITY_DESCRIPTION] = "Received Essay"
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Feb 2021 22:14:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678242#M34392</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-02-19T22:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678681#M34412</link>
      <description>&lt;P&gt;That won't work because some students are in the Activity Log and havn't requested assignment yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data example:&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Recieved Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1 - Logout&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2 - Recieved Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - Requested Assignment&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3 - No Essay&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;4 - Login&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;4 - Logout&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So in this example student #4 logged in but didn't request assignment. There are other activities but I don't want to confuse you. So I really need a "NOT IN" filter.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 15:31:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678681#M34412</guid>
      <dc:creator>MrMike</dc:creator>
      <dc:date>2021-02-20T15:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678696#M34413</link>
      <description>&lt;P&gt;As an easy alternative can you have a table where you just pivot the activity descriptions (only the ones that you need) into columns.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;from what you mention you might only need 2 columns pivoted&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Requested&lt;/P&gt;&lt;P&gt;2. submitted&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you have option of adding a conditional column in PQ to flag students who have requstwd but not submitted or you can calculate that using dax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR _count = countrows(activity_log)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;caculate(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; _count,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Activity_log[requested]&amp;lt;&amp;gt; null &amp;amp;&amp;amp; isblank(activity_log[submitted]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*code written in back of cab so possible error.... but I hope you get my drift*&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;one question to better understand context. Will the same student have multiple essays where this needs to be checked? &amp;nbsp;If so then a unique identifier for the assignment also needs to be included so you have granularity and a studentID-AssigmentID level&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? Mark my post as a solution if I did! Like it if it helped.&amp;nbsp; Appreciate the Kudos!!&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 16:20:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1678696#M34413</guid>
      <dc:creator>Carmichael</dc:creator>
      <dc:date>2021-02-20T16:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690016#M34731</link>
      <description>&lt;P&gt;I tired your suggestion but that caused more errors.&lt;/P&gt;&lt;P&gt;Are you saying there is no "NOT IN" function in Power BI so I have to create a pivot table?&lt;/P&gt;&lt;P&gt;Is there some way to use my SQL that has a "NOT IN" in the Power BI data source?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 15:37:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690016#M34731</guid>
      <dc:creator>MrMike</dc:creator>
      <dc:date>2021-02-25T15:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690076#M34735</link>
      <description>&lt;P&gt;OK. I think you'd want something like this then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Students Missing Essay =
SUMX (
    VALUES ( ACTIVITY_LOG[STUDENT_ID] ),
    VAR Descriptions = CALCULATETABLE ( VALUES ( ACTIVITY_LOG[ACTIVITY_DESCRIPTION] ) )
    RETURN
        IF (
            "Requested Assignment" IN Descriptions
                &amp;amp;&amp;amp; NOT ( "Recieved Essay" IN Descriptions ),
            1,
            0
        )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 22:13:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690076#M34735</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-02-25T22:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690553#M34755</link>
      <description>&lt;P&gt;I tired your example and I get a syntex error on both Descriptions words. The error says "The function expects a table expression for argument '', but a string or numeric expression was used."&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 21:48:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690553#M34755</guid>
      <dc:creator>MrMike</dc:creator>
      <dc:date>2021-02-25T21:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690576#M34758</link>
      <description>&lt;P&gt;That's what I get for not testing...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should be CALCULATETABLE instead of CALCULATE and I failed to preserve your misspelling of "Recieved".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will edit it momentarily.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2021 22:13:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690576#M34758</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-02-25T22:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690586#M34759</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please try this measure and let me know if it works:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Measure :=

VAR _StudentsWithoutEssay = 
	CALCULATETABLE (
		VALUES ( ACTIVITY_LOG[STUDENT_ID] ), 
		ACTIVITY_LOG[ACTIVITY_DESCRIPTION] = "No Essay"
	)

VAR _Result = 
	CALCULATE (
		DISTINCTCOUNT ( ACTIVITY_LOG[STUDENT_ID] ), 
		ACTIVITY_LOG[ACTIVITY_DESCRIPTION] = "Requested Assignment", 
		NOT ACTIVITY_LOG[STUDENT_ID] IN _StudentsWithoutEssay
	)

RETURN
_Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Feb 2021 22:19:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1690586#M34759</guid>
      <dc:creator>AmedeoM</dc:creator>
      <dc:date>2021-02-25T22:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter and not in filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1693010#M34818</link>
      <description>&lt;P&gt;That worked! I verified with several different date ranges and results came back as expected. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 20:29:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/1693010#M34818</guid>
      <dc:creator>MrMike</dc:creator>
      <dc:date>2021-02-26T20:29:16Z</dc:date>
    </item>
    <item>
      <title>essay</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/2968943#M99163</link>
      <description>&lt;P&gt;Essays can be a rewarding and challenging type of writing and are often assigned either to be done in class, which requires previous planning and practice (and a bit of creativity) on the part of the student, or as homework, which likewise demands a certain amount of preparation&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 21:03:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-and-not-in-filter/m-p/2968943#M99163</guid>
      <dc:creator>Martin125</dc:creator>
      <dc:date>2022-12-14T21:03:58Z</dc:date>
    </item>
  </channel>
</rss>

