<?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: Different results of All and Summarize function on a column both combined with Keepfilters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141638#M112201</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433785" data-lia-user-login="ARU_" class="lia-mention lia-mention-user"&gt;ARU_&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Basically in the first one you are removing the filter "ALL (&amp;nbsp;&lt;SPAN&gt;Customer[Education] )"&lt;/SPAN&gt;&amp;nbsp;and the keeping it "KEEPFILTERS" so it is basically doing nothing. The remaining ALL ( Sales ) will remove all filters from 'Sales'&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The second one by wrapping SUMMARIZE with KEEPFILTERS nothing will change as SUMMARIZE is already carrying the outer fiilter along with it "which also doesn't make sense". The SUMMARIZE by one column is just the VALUES of that column. Now, ALL ( 'Sales' ) will be intersected with VALUES (&amp;nbsp;&lt;SPAN&gt;Customer[Education] ) and all filters from 'Sales' are removed and the filter from&amp;nbsp;Customer[Education] is kept.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note that&amp;nbsp;Customer[Education] column is part of the expaned Sales table.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2023 07:22:10 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-03-20T07:22:10Z</dc:date>
    <item>
      <title>Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141460#M112191</link>
      <description>&lt;P&gt;Hello, I am new to DAX and have recently completed the evaluation concepts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering why following yield different result from the other function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link to access pbix on which i am working on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/17uSqXKk-zgmFlRF9XLDnYpsIJZQxhemt/view?usp=sharing" target="_blank" rel="nofollow noopener noreferrer"&gt;https://drive.google.com/file/d/17uSqXKk-zgmFlRF9XLDnYpsIJZQxhemt/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;DAX 1&lt;/STRONG&gt;&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;&lt;STRONG&gt;DAX 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just replaced All filter with Summarize function. I understand that when All function is used with a column reference then it yields unique values of the column. While Summarize function (when applied on a column) provides unique values.&amp;nbsp; Both these functions being filter parameters of Calculate functions work in original filter context environment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way i understand keepfilters works, it intersect the values of columns in original filter context and the values derived of the same column in keepfilters function. Ideally, i was expecting them to yield the same result. However, in this case as we see, it is yielding different output.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time in going through the question and helping me out !&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 05:59:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141460#M112191</guid>
      <dc:creator>ARU_</dc:creator>
      <dc:date>2023-03-20T05:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141570#M112198</link>
      <description>&lt;P&gt;with your code, the results will be same with KEEPFILTERS or not. all the outside filters has been removed by ALL(Sales). DAX1, ALL(Customer[Education]) is useless, its filter range is overlaped by ALL(). but DAX2, SUMMARIZE(...) or VALUES(...) refilter the data with Educations, just remove the filter of Fiscal Year, result same as this code:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;DAX2 = &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Sales Amount]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;[Sales Amount]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Fiscal Year]&lt;/SPAN&gt;&lt;SPAN&gt;) ))&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 06:56:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141570#M112198</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2023-03-20T06:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141638#M112201</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433785" data-lia-user-login="ARU_" class="lia-mention lia-mention-user"&gt;ARU_&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Basically in the first one you are removing the filter "ALL (&amp;nbsp;&lt;SPAN&gt;Customer[Education] )"&lt;/SPAN&gt;&amp;nbsp;and the keeping it "KEEPFILTERS" so it is basically doing nothing. The remaining ALL ( Sales ) will remove all filters from 'Sales'&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The second one by wrapping SUMMARIZE with KEEPFILTERS nothing will change as SUMMARIZE is already carrying the outer fiilter along with it "which also doesn't make sense". The SUMMARIZE by one column is just the VALUES of that column. Now, ALL ( 'Sales' ) will be intersected with VALUES (&amp;nbsp;&lt;SPAN&gt;Customer[Education] ) and all filters from 'Sales' are removed and the filter from&amp;nbsp;Customer[Education] is kept.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Note that&amp;nbsp;Customer[Education] column is part of the expaned Sales table.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 07:22:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141638#M112201</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-20T07:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141752#M112208</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&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;, Thanks for ur explanation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that removing keepfilters / all is redundant in &lt;STRONG&gt;DAX1&lt;/STRONG&gt;. The thing which i fail to understand is why it is so.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me explain how i think DAX is evaluating this line of code :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keepfilters(all(Customer[Education])&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am taking blue cell in the below screenshot to explain the DAX evaluation steps that i understand.&amp;nbsp;&lt;/SPAN&gt;&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;&lt;P&gt;&lt;SPAN&gt;Step 1 : "All" being an inner function will first be evaluated which will give you distinct values of customer[Education] column. It basically returns a table with only one column containing distinct values&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Step 2: keepfilters function accepts table as an expression. Step 1 returns a table expression containing all distinct values of customer[Education] column. As keepfilters is being used in Calculate , it will make use of these values to be intersected with original context values of the same column i.e Customer[Education].&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Step 3: As we have customer[Education] on rows in the matrix, the original context for blue cell in the matrix has 'Bachelors' filter applied (which is the original context).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Step 4 : The intersection of Step 3 ('Bachelors') and Step 2 (All values of Customer[Education]) should return 'Bachelors' filter to be applied on that cell.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, instead of applying filter on 'Bachelors' education only, it is removing filter from customer[education] column. Not sure why ? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I know that this is how the DAX is not computing and hence its results are different from the above steps. I dont understand what piece of puzzle am i missing here.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Again, Thank you so much for attempting to help here.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.s - For the sake of simplicity and providing exactly where my confusion lies, i am not giving much important to the filter on sales table.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 08:10:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141752#M112208</guid>
      <dc:creator>ARU_</dc:creator>
      <dc:date>2023-03-20T08:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141779#M112211</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="264353" data-lia-user-login="wdx223_Daniel" class="lia-mention lia-mention-user"&gt;wdx223_Daniel&lt;/a&gt;&amp;nbsp; - Thanks for your explanation. I have no concern about DAX2. The reason i provided it is because i expected DAX 1 to have the same results as DAX2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You say "All" overlaps the filter of Customer[Education] which i get. The thing which i don't understand why does it overlap?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per the evaluation steps provided in the response to&amp;nbsp;tamerj1, Keepfilters behaviour is to intersect the original context of a column with the new context as provided by keepfilters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence, DAX ideally shouldnt be removing / overriding the filter coming from the original context as is happening in this case.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time in helping me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 08:22:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141779#M112211</guid>
      <dc:creator>ARU_</dc:creator>
      <dc:date>2023-03-20T08:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141815#M112212</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="433785" data-lia-user-login="ARU_" class="lia-mention lia-mention-user"&gt;ARU_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is with your understanding of step1. Here ALL is not a filter expression rather it is a calculate modifier exactly as REMOVEFILTERS. Actually REMOFILTERS was later introduced just to clear this confusion about the double face of ALL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You think that ALL (&amp;nbsp;&lt;SPAN&gt;Customer[Education] ) translates into&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FILTER ( ALL (&amp;nbsp;Customer[Education] ), TRUE ( ) )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;but this is not true. It actually translates to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;REMOVEFILTERS (&amp;nbsp;Customer[Education] )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore your argument is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;KEEPFILTERS (REMOVEFILTERS (&amp;nbsp;Customer[Education] ) )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;which means nothing&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 08:41:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3141815#M112212</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-03-20T08:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Different results of All and Summarize function on a column both combined with Keepfilters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3142047#M112226</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&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;for your lucid explanation. It makes sense to me now!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 10:05:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-results-of-All-and-Summarize-function-on-a-column-both/m-p/3142047#M112226</guid>
      <dc:creator>ARU_</dc:creator>
      <dc:date>2023-03-20T10:05:08Z</dc:date>
    </item>
  </channel>
</rss>

