<?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 in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473491#M28016</link>
    <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your example is bit closer to what I want but still not ideal.&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;Now one user gives me wrong result and somehow I think I need to take period into the account? The example shows where 2 is shown as "Yes" which is great and bottom one is wrong. I am also filtering the visual itself by week offset (taking only last 4 weeks) . The difference between these users is:&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;</description>
    <pubDate>Wed, 04 Nov 2020 06:59:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-04T06:59:24Z</dc:date>
    <item>
      <title>Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1472403#M27972</link>
      <description>&lt;P&gt;Hi all. I can not seem to figure out the filter context and calculated column will not give me the expected results.&lt;/P&gt;&lt;P&gt;The measure is the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Teams Channels =&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR current_user = 'Teams statistics'[User Principal Name]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR amount_per_user= CALCULATE(SUM('Teams statistics'[Team Chat Message Count]), FILTER('Teams statistics','Teams statistics'[User Principal Name]=current_user))&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(amount_per_user&amp;gt;=2, "Yes", "No")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And as per screenshot where count is 1 it says "Yes" but as per above condition it should not. Can you advise how to amend it?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 04 Nov 2020 06:11:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1472403#M27972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-04T06:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1472427#M27974</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Is&amp;nbsp;&lt;SPAN&gt;'Teams&amp;nbsp;statistics'[User&amp;nbsp;Principal&amp;nbsp;Name] a measure or a refrence to a column or you didn't wrap inside SELECTEDVALUE?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Teams Channels =
VAR current_user = 'Teams statistics'[User Principal Name]
VAR amount_per_user =
    CALCULATE (
        SUM ( 'Teams statistics'[Team Chat Message Count] ),
        'Teams statistics'[User Principal Name] = current_user,
        REMOVEFILTERS ( 'Teams statistics' )
    )
RETURN
    IF ( amount_per_user &amp;gt;= 2, "Yes", "No" )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 18:23:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1472427#M27974</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-11-03T18:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1472449#M27978</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;, with regard to this part of the measure in question,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR amount_per_user =
CALCULATE (
    SUM ( 'Teams statistics'[Team Chat Message Count] ),
    FILTER (
        'Teams statistics',
        'Teams statistics'[User Principal Name] = current_user
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;'Teams&amp;nbsp;statistics'&lt;/EM&gt; is already filtered in the initial filter context (row from table/matrix, selection of slicer, interaction from other viz, etc.)&amp;nbsp;before it's further filtered by FILTER().&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I assume that you tend to filter the whole&amp;nbsp;&lt;EM&gt;'Teams&amp;nbsp;statistics'&lt;/EM&gt; table with condition&amp;nbsp;'Teams statistics'[User Principal Name] = current_user; if so, this variable can be simplified this way,&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR amount_per_user =
CALCULATE (
    SUM ( 'Teams statistics'[Team Chat Message Count] ),
    'Teams statistics'[User Principal Name] = current_user
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://mdxdax.blogspot.com/2011/03/" target="_blank" rel="noopener"&gt;&lt;EM&gt;&lt;STRONG&gt;This classic article&lt;/STRONG&gt;&lt;/EM&gt;&lt;/A&gt; by Jeffrey Wang unveiled some sophisticated details of mechanism of filter context. I strongly recommend it if you'd like to dig deeper into filter context in DAX. Enjoy!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 18:36:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1472449#M27978</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2020-11-03T18:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473408#M28013</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you and apologies, this is not the measure but calculated column I am trying to get as eventually I will have to count "Yes'es" and not sure if masure will serve this purpose...?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'Teams&amp;nbsp;statistics'[User&amp;nbsp;Principal&amp;nbsp;Name]&amp;nbsp; is a column, and I di not wrap it in VALUES.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am afraid your suggestion still gives me same result &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 06:15:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473408#M28013</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-04T06:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473491#M28016</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your example is bit closer to what I want but still not ideal.&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;Now one user gives me wrong result and somehow I think I need to take period into the account? The example shows where 2 is shown as "Yes" which is great and bottom one is wrong. I am also filtering the visual itself by week offset (taking only last 4 weeks) . The difference between these users is:&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;</description>
      <pubDate>Wed, 04 Nov 2020 06:59:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473491#M28016</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-04T06:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473546#M28018</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;, also Teams Channels is calculated column I am trying to create as later I will have to count "Yes'es". Could it be the problem ?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 07:12:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473546#M28018</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-04T07:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473921#M28020</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Can you please attach sample dataset?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 09:44:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-context/m-p/1473921#M28020</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-11-04T09:44:33Z</dc:date>
    </item>
  </channel>
</rss>

