<?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 fuction in CALCULATE causes ALL function not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/774146#M3828</link>
    <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="164783" data-lia-user-login="kanielwang" class="lia-mention lia-mention-user"&gt;kanielwang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this. It's the equivalent of TotalOpenOrderAmount1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TotalOpenOrderAmount2 = CALCULATE	([OrderAmount]-[ShippedAmount],
				ALL(CalendarDate),
				Filter(&lt;FONT color="#FF0000"&gt;ALL(&lt;/FONT&gt;OrderLineDetail&lt;FONT color="#FF0000"&gt;[Status])&lt;/FONT&gt;,OrderLineDetail[Status]="Open")
				）&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2019 09:55:38 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2019-08-23T09:55:38Z</dc:date>
    <item>
      <title>FILTER fuction in CALCULATE causes ALL function not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/773976#M3820</link>
      <description>&lt;PRE&gt;TotalOpenOrderAmount1 = CALCULATE	([OrderAmount]-[ShippedAmount],
				ALL(CalendarDate),
				OrderLineDetail[Status]="Open")

TotalOpenOrderAmount2 = CALCULATE	([OrderAmount]-[ShippedAmount],
				ALL(CalendarDate),
				Filter(OrderLineDetail,OrderLineDetail[Status]="Open")
				）&lt;/PRE&gt;&lt;P&gt;TotalOpenOderAmount1 can be measured as expected.&lt;/P&gt;&lt;P&gt;But TotalOpenOrderAmount2 is still affected by Calendar filters on the report.&lt;/P&gt;&lt;P&gt;Why is that? Can someone help to explain it?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 07:32:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/773976#M3820</guid>
      <dc:creator>kanielwang</dc:creator>
      <dc:date>2019-08-23T07:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER fuction in CALCULATE causes ALL function not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/774146#M3828</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="164783" data-lia-user-login="kanielwang" class="lia-mention lia-mention-user"&gt;kanielwang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this. It's the equivalent of TotalOpenOrderAmount1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TotalOpenOrderAmount2 = CALCULATE	([OrderAmount]-[ShippedAmount],
				ALL(CalendarDate),
				Filter(&lt;FONT color="#FF0000"&gt;ALL(&lt;/FONT&gt;OrderLineDetail&lt;FONT color="#FF0000"&gt;[Status])&lt;/FONT&gt;,OrderLineDetail[Status]="Open")
				）&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 09:55:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/774146#M3828</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-08-23T09:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER fuction in CALCULATE causes ALL function not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/774245#M3832</link>
      <description>When you use a table name in a table function, you are in fact referring to the table as it's seen in the current filter context. So, Filter( Table, ...) sees Table as it's filtered, not the whole table. Hence you filter Table which is already filtered by the other filters.&lt;BR /&gt;&lt;BR /&gt;Understandable?&lt;BR /&gt;&lt;BR /&gt;Remember that&lt;BR /&gt;calculate(&lt;BR /&gt;    [...],&lt;BR /&gt;    Table[Col] = "value"&lt;BR /&gt;)&lt;BR /&gt;is syntactic sugar for&lt;BR /&gt;calculate(&lt;BR /&gt;    [...],&lt;BR /&gt;    filter(&lt;BR /&gt;        ALL ( Table[Col] ),&lt;BR /&gt;        Table[Col] = "value"&lt;BR /&gt;    )&lt;BR /&gt;)&lt;BR /&gt;which is very much different from&lt;BR /&gt;calculate(&lt;BR /&gt;    [...],&lt;BR /&gt;    filter(&lt;BR /&gt;        values ( Table[Col] ),&lt;BR /&gt;        Table[Col] = "value"&lt;BR /&gt;    )&lt;BR /&gt;)&lt;BR /&gt;and the latter is equivalent to&lt;BR /&gt;calculate(&lt;BR /&gt;    [...],&lt;BR /&gt;    keepfilters( Table[Col] = "value" )&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Fri, 23 Aug 2019 12:02:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-fuction-in-CALCULATE-causes-ALL-function-not-working/m-p/774245#M3832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T12:02:22Z</dc:date>
    </item>
  </channel>
</rss>

