<?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: ALL showing an unexpected behavior in a matrix in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140882#M164554</link>
    <description>&lt;PRE&gt;&lt;SPAN&gt;The ALL() function used in as a filter in Calculate is removing the filter on product_subcategory, so it works on Matrix B which uses product_subcategory in the first row,&lt;BR /&gt;but not matrix A which has product_category in the first column. Matrix A is not being filtered by product_subcategory, so there&lt;BR /&gt;is nothing to remove.&lt;BR /&gt;&lt;BR /&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;products&lt;/SPAN&gt;&lt;SPAN&gt;[product_subcategory]&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Sep 2024 14:43:52 GMT</pubDate>
    <dc:creator>FlipFlop1</dc:creator>
    <dc:date>2024-09-09T14:43:52Z</dc:date>
    <item>
      <title>ALL showing an unexpected behavior in a matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140529#M164532</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm working on a dataset based on the following data model (well, it's part of it) :&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;&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;P&gt;&amp;nbsp;&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;&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;P&gt;&amp;nbsp;&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;&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Il created the following measure to calculate the sum of quantity without taking into account the product's sub-category :&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Measure =&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sales&lt;/SPAN&gt;&lt;SPAN&gt;[quantity]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;products&lt;/SPAN&gt;&lt;SPAN&gt;[product_subcategory]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;When the measure is used in a matrix view it shows a peculiar behavior :&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Both visuals (A) and (B) are filtered on the products' prices (slicer in the bottom left) and of&lt;STRONG&gt; Product_Category = "Office Supplies"&lt;/STRONG&gt;. Table (B) matches the expected behavior, which is not the case for table (A).&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note that using ALLSELECTED instead of ALL fixes that issue.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;When the slicer is based on a calculated column in the sales table&lt;BR /&gt;( product_price&amp;nbsp; =&amp;nbsp;&lt;SPAN&gt;related&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;products&lt;/SPAN&gt;&lt;SPAN&gt;[product_salePrice]&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;nbsp; ) the expected behavior is shown in the visual (A).&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;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is that the normal behavior for ALL ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance,&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Sep 2024 11:37:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140529#M164532</guid>
      <dc:creator>zoubeyrB</dc:creator>
      <dc:date>2024-09-09T11:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: ALL showing an unexpected behavior in a matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140725#M164542</link>
      <description>&lt;P&gt;Any sort column involved?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 13:27:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140725#M164542</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-09T13:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: ALL showing an unexpected behavior in a matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140865#M164551</link>
      <description>&lt;P&gt;No. I think that DAX aggregates on product_saleprice as well. If I make the following calculations I get the same results :&lt;BR /&gt;1) initial dataset ==&amp;gt;&amp;nbsp; filter on product_saleprice &amp;gt; 60 ==&amp;gt; aggregate on &lt;STRONG&gt;product_Category&lt;/STRONG&gt; and &lt;STRONG&gt;product_saleprice&lt;/STRONG&gt; and calculate the total quantity for each combination of values (&lt;STRONG&gt;sum1&lt;/STRONG&gt;)&amp;nbsp;&lt;BR /&gt;2)&amp;nbsp; initial dataset ==&amp;gt;&amp;nbsp; filter on product_saleprice &amp;gt; 60 ==&amp;gt; select distinct values of &lt;STRONG&gt;product_Category, product_subCategory and product_saleprice&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3) join results from steps (1) and (2)&lt;BR /&gt;4) result of step 3 ==&amp;gt; aggregate on product_Category and product_subCategory and calculate the sum of &lt;STRONG&gt;sum1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculation seems coherent (filter then aggregate on all fields excluding product_subcategory), but the viewed result is misleading. A more correct result can be obtained from the following formula :&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;measure2 =&amp;nbsp;&lt;/SPAN&gt;CALCULATE&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sales&lt;/SPAN&gt;&lt;SPAN&gt;[quantity]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;
&lt;SPAN&gt;                       ALLSELECTED(products[product_subcategory],products[product_salePrice]))&lt;/SPAN&gt;
&lt;SPAN&gt;                    )&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Sep 2024 15:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140865#M164551</guid>
      <dc:creator>zoubeyrB</dc:creator>
      <dc:date>2024-09-09T15:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: ALL showing an unexpected behavior in a matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140882#M164554</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;The ALL() function used in as a filter in Calculate is removing the filter on product_subcategory, so it works on Matrix B which uses product_subcategory in the first row,&lt;BR /&gt;but not matrix A which has product_category in the first column. Matrix A is not being filtered by product_subcategory, so there&lt;BR /&gt;is nothing to remove.&lt;BR /&gt;&lt;BR /&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;products&lt;/SPAN&gt;&lt;SPAN&gt;[product_subcategory]&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2024 14:43:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4140882#M164554</guid>
      <dc:creator>FlipFlop1</dc:creator>
      <dc:date>2024-09-09T14:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: ALL showing an unexpected behavior in a matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4169707#M165640</link>
      <description>&lt;P&gt;Hi all ,thanks for the quick reply, I'll add more.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299599" data-lia-user-login="zoubeyrB" class="lia-mention lia-mention-user"&gt;zoubeyrB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Regarding your question, this may involve the underlying principle of the 'ALL' function. When I removed the slicer and used the filter condition of 'price &amp;gt; 60' as the parameter of the Calculated function, the 'ALL' function worked properly, so I think if a column is affected by indirect filtering, the 'ALL' function cannot clear the filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Wenbin Zhou&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 07:22:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-showing-an-unexpected-behavior-in-a-matrix/m-p/4169707#M165640</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-24T07:22:42Z</dc:date>
    </item>
  </channel>
</rss>

