<?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 Context within variable in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567087#M73178</link>
    <description>&lt;P&gt;Hi, can you post the SQL to have a look?&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 15:57:41 GMT</pubDate>
    <dc:creator>milanpasschier2</dc:creator>
    <dc:date>2022-06-08T15:57:41Z</dc:date>
    <item>
      <title>Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2558495#M72726</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I'm working on a DAX measure that will provide the count of students who enrolled in classes during their first fall and winter quarters. PBIX File here: &lt;A href="https://drive.google.com/file/d/1SGXJN1Wo-SoqGJpe0ZwsPoRlYYr3-o0p/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1SGXJN1Wo-SoqGJpe0ZwsPoRlYYr3-o0p/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Most fields should be self explanatory, but the Sequence ID is some maths I'm doing in SQL to separate non-consecutive enrollment terms. So, a student who enrolled in classes across 3 quarters with a break between two would look something like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note: This is based on academic year so, the Year is effectively the graduating year, and could also be written as Summer 2019-2020&lt;BR /&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;got me a lot further in my hunt with the following post&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-count-values-that-satisfy-multiple-conditions-in-a-column/m-p/875800#M419951" target="_self"&gt;How to count values that satisfy multiple conditions in a column&lt;/A&gt;&amp;nbsp;but I cannot get the second part of my filter to work (only counting their first fall and winter quarter).&lt;BR /&gt;&lt;BR /&gt;My goal is to only look at records that have the lowest Sequence ID for each Student ID and that have a sequential "Fall" [Year] -&amp;gt; "Winter" [Year].&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 18:47:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2558495#M72726</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-03T18:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2559022#M72751</link>
      <description>&lt;P&gt;HI Turduckin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you show a sample of the output you are looking for?&amp;nbsp; Two or three rows in this output&amp;nbsp; should help&amp;nbsp; us to suggest you a solution to your problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2022 17:11:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2559022#M72751</guid>
      <dc:creator>ManguilibeKAO</dc:creator>
      <dc:date>2022-06-04T17:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2561859#M72903</link>
      <description>&lt;P&gt;Sorry about that, I added it to my uploaded pbix model, but I didn't provide any comments on it.&lt;BR /&gt;&lt;BR /&gt;I'd want my output to look something like this, but my current results are either fall, or winter. When really I want the fall followed by the subsequent winter quarter.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I'm getting the "Fall to Winter" column with the following DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Fall to Winter = &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_FirstSequence&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[First Sequence]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_Fall&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance[Student ID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance[Quarter Name]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Fall"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;StudentPersistance[Sequence ID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_FirstSequence&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_Winter&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance[Student ID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance[Quarter Name]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Winter"&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;StudentPersistance[Sequence ID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;_FirstSequence&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_Intersect&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INTERSECT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_Fall&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;_Winter&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_Intersect&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;[First Sequence] is the following measure:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;First Sequence = &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance[Sequence ID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;StudentPersistance[Student ID]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Jun 2022 18:33:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2561859#M72903</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-06T18:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2562291#M72927</link>
      <description>&lt;P&gt;Hello Turduckin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you want to explain, how in your output, you obtain a value of 4&amp;nbsp; in&amp;nbsp; &amp;nbsp;Fall to Winter, for the year 2019?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 00:25:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2562291#M72927</guid>
      <dc:creator>ManguilibeKAO</dc:creator>
      <dc:date>2022-06-07T00:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2564571#M73037</link>
      <description>&lt;P&gt;So, I looked more in depth at this and, I'm not sure &lt;span class="lia-unicode-emoji" title=":pensive_face:"&gt;😔&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;It looks like that whole equation isn't doing what I want, other than providing numbers split between years (but the numbers are incorrect).&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 16:08:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2564571#M73037</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-07T16:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2564709#M73048</link>
      <description>&lt;P&gt;So, on some further investigation using SQL to get the numbers I'm after, this is about what the numbers should look like and in the format I'd expect.&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;</description>
      <pubDate>Tue, 07 Jun 2022 17:28:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2564709#M73048</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-07T17:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2566259#M73132</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397335" data-lia-user-login="Turduckin" class="lia-mention lia-mention-user"&gt;Turduckin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Goal: "look at records that have the lowest Sequence ID for each Student ID",&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;get the first&amp;nbsp;Sequence ID of&amp;nbsp;each Student ID:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;MIN(StudentPersistance[Sequence ID])&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, "&lt;SPAN&gt;that have a sequential "Fall" [Year] -&amp;gt; "Winter" [Year]."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you explain what does it mean or how to calculate that by the following example.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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 _ chenwu zhu&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 10:12:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2566259#M73132</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-06-08T10:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567087#M73178</link>
      <description>&lt;P&gt;Hi, can you post the SQL to have a look?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 15:57:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567087#M73178</guid>
      <dc:creator>milanpasschier2</dc:creator>
      <dc:date>2022-06-08T15:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567104#M73180</link>
      <description>&lt;P&gt;I don't really understand the question, what is it you would like to calculate? How many of the students are in Fall &lt;STRONG&gt;and&lt;/STRONG&gt; Winter in the same year? You could try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;A = 


VAR _FALL = MAXX(CALCULATETABLE(StudentPersistance, FILTER(StudentPersistance, StudentPersistance[Quarter Name]="Fall")), StudentPersistance[Quarter Name])
VAR _WINTER = MAXX(CALCULATETABLE(StudentPersistance, FILTER(StudentPersistance, StudentPersistance[Quarter Name]="Winter")), StudentPersistance[Quarter Name])

RETURN

IF(_FALL = "Fall", 
IF(_WINTER = "Winter", 1
))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;B = SUMX(VALUES(StudentPersistance[Student ID]), _measures[A])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 16:02:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567104#M73180</guid>
      <dc:creator>milanpasschier2</dc:creator>
      <dc:date>2022-06-08T16:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567211#M73187</link>
      <description>&lt;P&gt;Hey thanks!&lt;BR /&gt;&lt;BR /&gt;I'm trying to grok the DAX you've written, but I'm kinda slow at it. In the meantime, the clarifcation statement that you have is &lt;EM&gt;almost&lt;/EM&gt; right: &amp;gt; H&lt;SPAN&gt;ow many of the students are in Fall&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;and&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;Winter in &lt;STRIKE&gt;the same&lt;/STRIKE&gt;&amp;nbsp;their first year.&lt;BR /&gt;&lt;BR /&gt;T&lt;/SPAN&gt;he SQL that got me closer to the answer looks something like this (sorry if the fields don't match 1:1 with the pbix file, I've been renaming for legibility):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;With DegreeSeekingStudents As(&lt;BR /&gt;SELECT&lt;BR /&gt;StudentID&lt;BR /&gt;FROM fact_Enrollment&lt;BR /&gt;Where&lt;BR /&gt;DegreeLevel in ('Undergrad','Graduate','Doctoral')&lt;BR /&gt;AND Group Not In ('ContinuingEd', 'NoCredit')&lt;BR /&gt;),&lt;BR /&gt;&lt;BR /&gt;CTE As(&lt;BR /&gt;Select&lt;BR /&gt;*,&lt;BR /&gt;MIN(AcademicYear) Over (Partition by StudentID) As FirstAY&lt;BR /&gt;From StudentPersistance&lt;BR /&gt;Where StudentID in (Select Distinct StudentID From DegreeSeekingStudents)&lt;BR /&gt;),&lt;BR /&gt;&lt;BR /&gt;CTE2 As(&lt;BR /&gt;Select&lt;BR /&gt;StudentID,&lt;BR /&gt;Term,&lt;BR /&gt;AcademicYear,&lt;BR /&gt;FirstAY&lt;BR /&gt;From CTE&lt;BR /&gt;Where&lt;BR /&gt;AcademicYear = FirstAY&lt;BR /&gt;And ( RIGHT(Term, 1) = 2 )&lt;BR /&gt;),&lt;BR /&gt;&lt;BR /&gt;CTE3 As(&lt;BR /&gt;Select&lt;BR /&gt;StudentID,&lt;BR /&gt;Term,&lt;BR /&gt;AcademicYear,&lt;BR /&gt;FirstAY&lt;BR /&gt;From CTE&lt;BR /&gt;Where&lt;BR /&gt;AcademicYear = FirstAY&lt;BR /&gt;And ( RIGHT(Term, 1) = 3 )&lt;BR /&gt;),&lt;BR /&gt;&lt;BR /&gt;CTE4 As(&lt;BR /&gt;Select&lt;BR /&gt;CTE2.StudentID,&lt;BR /&gt;CTE2.Term As FallTerm,&lt;BR /&gt;CTE3.Term As WinterTerm,&lt;BR /&gt;CTE2.FirstAY&lt;BR /&gt;From CTE2&lt;BR /&gt;Join CTE3 On CTE2.StudentID = CTE3.StudentID&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Select FirstAY, Count(*) As FallToWinter&lt;BR /&gt;From CTE4&lt;BR /&gt;Group by FirstAY&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Jun 2022 17:22:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567211#M73187</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-08T17:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567216#M73188</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;from the screenshot, the expected outcome would be 1 as only student id 11003483 has a Fall and Winter quarter enrollment in their first year.&lt;BR /&gt;&lt;BR /&gt;The Sequence ID may be spurious when what I'm looking for is minimum year. Which, I can get the minimum year when the emplid is provided in a table visualization, but I get confused on how to get that Student ID's minimum year in the variable and have it return that person's min year and not the overall min year.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 17:27:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567216#M73188</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-08T17:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567376#M73198</link>
      <description>&lt;P&gt;Ty, i'll have a look tomorrow &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 19:06:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2567376#M73198</guid>
      <dc:creator>milanpasschier2</dc:creator>
      <dc:date>2022-06-08T19:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2572777#M73558</link>
      <description>&lt;P&gt;Hey &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397335" data-lia-user-login="Turduckin" class="lia-mention lia-mention-user"&gt;Turduckin&lt;/a&gt; ,&lt;BR /&gt;&lt;BR /&gt;Create a calculated column FallAndWinter:&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;FallAndWinter = 

VAR CurrentTypeQuarterName = StudentPersistance[Quarter Name]

VAR CurrentStudentYearTable =
    CALCULATETABLE (
        StudentPersistance,
        ALLEXCEPT ( StudentPersistance, StudentPersistance[Student ID], StudentPersistance[Year] )
    )

VAR HasWinter = FILTER(CurrentStudentYearTable, StudentPersistance[Quarter Name] = "Winter")

RETURN

IF (CurrentTypeQuarterName = "Fall",
    IF (
        NOT(ISBLANK(COUNTROWS(HasWinter))), 1
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this you can create a measure to calculate how many of the students are in Fall &lt;STRONG&gt;and&lt;/STRONG&gt; Winter in the their first year:&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;Students in Fall And Winter First Year = 

VAR CurrentYear = MAX(StudentPersistance[Year])

VAR StudentTable =
    CALCULATETABLE (
        StudentPersistance,
        ALLEXCEPT ( StudentPersistance, StudentPersistance[Student ID] )
    )

VAR FirstFallAndWinter = MINX(FILTER(StudentTable, StudentPersistance[FallAndWinter] = 1), StudentPersistance[Year])

RETURN

IF (CurrentYear == FirstFallAndWinter, 1)&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;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Students in Fall and Winter First Year = SUMX(VALUES(StudentPersistance[Student ID]), _measures[Students in Fall And Winter First Year])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can download the pbix-file here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;A href="https://milanpasschier2.s3.eu-central-1.amazonaws.com/Com+3.pbix" target="_blank" rel="noopener"&gt;https://milanpasschier2.s3.eu-central-1.amazonaws.com/Com+3.pbix&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Milan&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2022 08:33:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2572777#M73558</guid>
      <dc:creator>milanpasschier2</dc:creator>
      <dc:date>2022-06-11T08:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Filter Context within variable</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2575694#M73748</link>
      <description>&lt;P&gt;Milan,&lt;BR /&gt;&lt;BR /&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 15:52:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-Context-within-variable/m-p/2575694#M73748</guid>
      <dc:creator>Turduckin</dc:creator>
      <dc:date>2022-06-13T15:52:06Z</dc:date>
    </item>
  </channel>
</rss>

