<?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: SUM Only Specified Values For All Higher Matrix Levels in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3355590#M126090</link>
    <description>&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Please do not apologize for any delay.&amp;nbsp; I genuinely appreciate you getting back to me.&lt;/P&gt;&lt;P&gt;2) This is great!&amp;nbsp; Thank you very much for the help!&lt;/P&gt;&lt;P&gt;3) Trying to understand a bit more about your code .&amp;nbsp; From what I can see, the only difference in your code is that it adds SUMX &amp;amp; SUMMARIZE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Below is the real code modified according to your instructions, which is why the var &amp;amp; column names are changed.&amp;nbsp; It's working beautifully, thanks to you.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;02 Installed Tamerj1 =&lt;/P&gt;&lt;P&gt;VAR WrittenExists = [Written Zeros STAGE] &amp;gt; 0&lt;/P&gt;&lt;P&gt;VAR InstalledAllQuarters =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SUMX(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'FactWrittenSales STAGE',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'DimSalesRep STAGE'[SalesPersonName],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'DimCustomer STAGE'[CustomerName],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'DimProduct STAGE'[PRODUCT_CODE]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Installed Zeros STAGE],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; REMOVEFILTERS('DimCalendar STAGE'[FiscalQTRYearName])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR Result =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; IF(WrittenExists, InstalledAllQuarters)&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I perform only the SUMMARIZE by itself in Dax Studio, it returns 39,705 rows for the 3 summarized columns (SalesPersonName, CustomerName, PRODUCT_CODE).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this mean that the SUMX iterates over all 39,705 rows, performing my CALCULATE statement for each row &amp;amp; then summing the total?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or does it&amp;nbsp; mean that the SUMX iterates only over the rows&amp;nbsp;&lt;EM&gt;in the current Filter Context of the matrix (&lt;/EM&gt;a tiny subset of the 39,705 which only contains 3 PRODUCT_CODE values in this example)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2023 14:48:46 GMT</pubDate>
    <dc:creator>Take2</dc:creator>
    <dc:date>2023-07-28T14:48:46Z</dc:date>
    <item>
      <title>SUM Only Specified Values For All Higher Matrix Levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3343660#M125506</link>
      <description>&lt;P&gt;Hello -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the link to the PBIX:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1vdZmj0n0-JpCXnQ6kqTgxxjGW_8x-rx8/view?usp=drive_link" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1vdZmj0n0-JpCXnQ6kqTgxxjGW_8x-rx8/view?usp=drive_link&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following Rows exist in the below Matrix:&lt;/P&gt;&lt;P&gt;- SalesRep Name&lt;/P&gt;&lt;P&gt;- Customer Name&lt;/P&gt;&lt;P&gt;- Product Name&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;ISSUE: The values highlighted in yellow are not correct.&amp;nbsp; Instead, they should be the SUM of Isolated Type 2 Desired Values ([z1 Isolate T2 Desired Values]).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DESIRED RESULT:&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;Measures are as follows:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&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;img /&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;So the last measure [z1 Isolate T2 Desired Values] is correctly identifying the rows that should be SUMMED.&lt;/P&gt;&lt;P&gt;However, I am not able to figure out how to SUM these values for all higher levels in the Matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 17:40:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3343660#M125506</guid>
      <dc:creator>Take2</dc:creator>
      <dc:date>2023-07-21T17:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Only Specified Values For All Higher Matrix Levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3344196#M125533</link>
      <description>&lt;P&gt;Well, I finally figured it out.&amp;nbsp; Only took me most the day of trial &amp;amp; error.&amp;nbsp; Oh DAX.&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;&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;Thanks to anyone who was trying to help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 20:37:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3344196#M125533</guid>
      <dc:creator>Take2</dc:creator>
      <dc:date>2023-07-21T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Only Specified Values For All Higher Matrix Levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3344295#M125538</link>
      <description>&lt;P&gt;OK, so it looks like I still need help.&amp;nbsp; My solution in the previous post only works on the dummy data set I created for sharing.&amp;nbsp; However, when I try to add the same simple measure to the matrix in the REAL report, the Matrix just spins endlessly (more than 10 minutes), and Performance Analyzer just spins as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The spinning starts the instant I attempt to add the measure [z2 Totals] to the Matrix.&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;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After spinning for 15 minutes, the matrix eventually fails:&lt;/P&gt;&lt;P&gt;"Cannot display the visual.&amp;nbsp; See Details."&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;I am confused how this can be running out of memory.&lt;/P&gt;&lt;P&gt;In the current FC (Filter Context), there are only 3 values for 'DimProduct STAGE'[PRODUCT_CODE] over which I &lt;I&gt;&lt;U&gt;&lt;STRONG&gt;want to be&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;&lt;/I&gt;iterating.&amp;nbsp; So how am I running out of memory?&lt;/P&gt;&lt;P&gt;1) $18.89&lt;/P&gt;&lt;P&gt;2) $4.58&lt;/P&gt;&lt;P&gt;3) $6.87&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can help me fix the measure so that it only handles the PRODUCT_CODE values displayed, I would greatly appreciate it.&amp;nbsp; This measure should take less than a second to process the resul.&amp;nbsp; So clearly my measure is very wrong....at least when performed against the real data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 22:06:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3344295#M125538</guid>
      <dc:creator>Take2</dc:creator>
      <dc:date>2023-07-21T22:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Only Specified Values For All Higher Matrix Levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3353761#M125971</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="592554" data-lia-user-login="Take2" class="lia-mention lia-mention-user"&gt;Take2&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Hi&amp;nbsp;&lt;SPAN&gt;Nathan. Apologies for the late response. I really didn't have the time to look into it. Please look at the proposed solution below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Type 2 V2 New = 
VAR Type1Exists = NOT ISBLANK ( [Type 1] )
VAR Type2AllQuarters =
    SUMX ( 
        SUMMARIZE ( 
            Data,
            SalesRep[SalesRep Name],
            Customer[Customer Name],
            'Product'[Product Name]
        ),
        CALCULATE (
            [Type 2],
            REMOVEFILTERS ( 'Calendar'[Year Quarter Number] )
        )
    )
VAR Result = 
    IF ( Type1Exists, Type2AllQuarters )
RETURN 
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Jul 2023 16:24:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3353761#M125971</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-07-27T16:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: SUM Only Specified Values For All Higher Matrix Levels</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3355590#M126090</link>
      <description>&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Please do not apologize for any delay.&amp;nbsp; I genuinely appreciate you getting back to me.&lt;/P&gt;&lt;P&gt;2) This is great!&amp;nbsp; Thank you very much for the help!&lt;/P&gt;&lt;P&gt;3) Trying to understand a bit more about your code .&amp;nbsp; From what I can see, the only difference in your code is that it adds SUMX &amp;amp; SUMMARIZE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Below is the real code modified according to your instructions, which is why the var &amp;amp; column names are changed.&amp;nbsp; It's working beautifully, thanks to you.&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;02 Installed Tamerj1 =&lt;/P&gt;&lt;P&gt;VAR WrittenExists = [Written Zeros STAGE] &amp;gt; 0&lt;/P&gt;&lt;P&gt;VAR InstalledAllQuarters =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; SUMX(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUMMARIZE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'FactWrittenSales STAGE',&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'DimSalesRep STAGE'[SalesPersonName],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'DimCustomer STAGE'[CustomerName],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'DimProduct STAGE'[PRODUCT_CODE]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [Installed Zeros STAGE],&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; REMOVEFILTERS('DimCalendar STAGE'[FiscalQTRYearName])&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;VAR Result =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; IF(WrittenExists, InstalledAllQuarters)&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I perform only the SUMMARIZE by itself in Dax Studio, it returns 39,705 rows for the 3 summarized columns (SalesPersonName, CustomerName, PRODUCT_CODE).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this mean that the SUMX iterates over all 39,705 rows, performing my CALCULATE statement for each row &amp;amp; then summing the total?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or does it&amp;nbsp; mean that the SUMX iterates only over the rows&amp;nbsp;&lt;EM&gt;in the current Filter Context of the matrix (&lt;/EM&gt;a tiny subset of the 39,705 which only contains 3 PRODUCT_CODE values in this example)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nathan&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 14:48:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SUM-Only-Specified-Values-For-All-Higher-Matrix-Levels/m-p/3355590#M126090</guid>
      <dc:creator>Take2</dc:creator>
      <dc:date>2023-07-28T14:48:46Z</dc:date>
    </item>
  </channel>
</rss>

