<?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: How to calculate total Sum in Matrix visual with complex calculation? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2967348#M99077</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;, AverageX is not the solution, the calculation is a little bit more complex, see below&lt;BR /&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thanks, this part is not the main problem, but thanks for the advise. To get the problem clearer, I try to explain the calculation with the image below:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It is a kind of three-steps-calculation:&lt;BR /&gt;- compare the count to the total for country&lt;BR /&gt;- multiply this with the level&lt;BR /&gt;- &lt;FONT color="#FF0000"&gt;sum up this results for the country&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;The red part is where I am lost ;-). This needs to be the _HAND_CALCULATE-Part.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;For the overall total ("Gesamt") it will be more or less the same, just changing step 1 to "compare to total for group".&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2022 07:58:05 GMT</pubDate>
    <dc:creator>OliTFD</dc:creator>
    <dc:date>2022-12-14T07:58:05Z</dc:date>
    <item>
      <title>How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2966430#M99023</link>
      <description>&lt;P&gt;I am stuck with a problem for some time now, and hope to get some help here.&amp;nbsp;&lt;BR /&gt;My data contains these for example:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Count" is the number of available positions in our case, "level" the percentage of how much of this position is allready financed. Every Country can have different amounts of positions with different levels in different years.&lt;BR /&gt;&lt;BR /&gt;What I finally want to show is drawn in this dummy (red numbers are calculated by hand an inserted in the screenshot ;-).&lt;BR /&gt;The totals should show the level on either country or total perspective, taking in count the part the level has on a row base compared to the sum of count for the total country (or overall on the bottom).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I manage to get the part for every type (full, part, none), as shown above as "Part of Country". But I have no idea how to calculate the percentage on a higher level, which is the sum of them. Even more complicated (for me): Getting the value for the overall perspective ("Gesamt", german).&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;What can I do to get results like in the dummy? The pbix for this demo can be &lt;A href="https://teachfirstdeutschland-my.sharepoint.com/:u:/g/personal/oliver_keinath_teachfirst_de/ERNeSuHqeVNKqj9hJLs9z4wBguy2D2BMSzfvK0TSyY-fzQ?e=VMLzas" target="_self"&gt;found here&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2022 21:47:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2966430#M99023</guid>
      <dc:creator>OliTFD</dc:creator>
      <dc:date>2022-12-13T21:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2966877#M99046</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294244" data-lia-user-login="OliTFD" class="lia-mention lia-mention-user"&gt;OliTFD&lt;/a&gt; , for the red one, try a measure like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AverageX(Table, [Count]*[Level])&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 03:07:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2966877#M99046</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-12-14T03:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2967192#M99066</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294244" data-lia-user-login="OliTFD" class="lia-mention lia-mention-user"&gt;OliTFD&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your statement, I think your want to get subtoatl in country level by another calculate logic. However, I am still confused about your calculate logic for red part in your screenshot. Here I suggest you to try ISINSCOPE() function to achieve your goal. Here I use 1 in hand calculate part.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Level % = 
VAR _HAND_CALCULATE = 1
RETURN
    IF (
        ISINSCOPE ( Facts[Type] ),
        SUM ( Facts[Level] ),
        IF ( ISINSCOPE ( Facts[Country] ), _HAND_CALCULATE )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 06:52:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2967192#M99066</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-14T06:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2967348#M99077</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;, AverageX is not the solution, the calculation is a little bit more complex, see below&lt;BR /&gt;Anonymous&lt;/a&gt;&amp;nbsp;Thanks, this part is not the main problem, but thanks for the advise. To get the problem clearer, I try to explain the calculation with the image below:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It is a kind of three-steps-calculation:&lt;BR /&gt;- compare the count to the total for country&lt;BR /&gt;- multiply this with the level&lt;BR /&gt;- &lt;FONT color="#FF0000"&gt;sum up this results for the country&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;The red part is where I am lost ;-). This needs to be the _HAND_CALCULATE-Part.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;For the overall total ("Gesamt") it will be more or less the same, just changing step 1 to "compare to total for group".&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 07:58:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2967348#M99077</guid>
      <dc:creator>OliTFD</dc:creator>
      <dc:date>2022-12-14T07:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2968506#M99130</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="294244" data-lia-user-login="OliTFD" class="lia-mention lia-mention-user"&gt;OliTFD&lt;/a&gt;&amp;nbsp;check out my blog post on this (I had a similar case where I wanted to sum quantities per productid , I am pretty sure you will find it useful). It is based on the SUM() OVER PARTITION BY of SQL , I think you can also use the same logic for your COUNT&amp;nbsp;&lt;A href="https://www.iipowerblog.com/post/sum-over-partition-by-in-powerbi" target="_blank"&gt;https://www.iipowerblog.com/post/sum-over-partition-by-in-powerbi&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 15:54:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2968506#M99130</guid>
      <dc:creator>IIPowerBlog</dc:creator>
      <dc:date>2022-12-14T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2968559#M99137</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="483781" data-lia-user-login="IIPowerBlog" class="lia-mention lia-mention-user"&gt;IIPowerBlog&lt;/a&gt;&amp;nbsp;thanks, but this does not seem to work. The Calculate(Sum(... needs a column... but I need to sum values of a measure, which depends on another measure.&lt;BR /&gt;As far as I see your solution does more or less the same as my "Total Count per Country)-measure from step 1.&lt;BR /&gt;Or do I get things wrong?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:15:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2968559#M99137</guid>
      <dc:creator>OliTFD</dc:creator>
      <dc:date>2022-12-14T16:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate total Sum in Matrix visual with complex calculation?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2968737#M99153</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="483781" data-lia-user-login="IIPowerBlog" class="lia-mention lia-mention-user"&gt;IIPowerBlog&lt;/a&gt;&amp;nbsp; At last your idea gave me the solution! I need to drop the measures, and do the calculations in columns, to finally sum them.&lt;BR /&gt;&lt;BR /&gt;First step: Get the count for the country&lt;BR /&gt;&lt;SPAN&gt;Total Count per Country COL = &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;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Count]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Group]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Country]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Second: Calculate the count compared to Country&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count compared to Country COL = &lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Count]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Total Count per Country COL]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Third: Multiply with level&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Part of Country COL = &lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Count compared to Country COL]&lt;/SPAN&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;SPAN&gt;Facts&lt;/SPAN&gt;&lt;SPAN&gt;[Level]&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;Finally sum this for the country level, same method for the group level. And then adjust the visible column in the matrix to&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Level % = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; Typelevel = &lt;/SPAN&gt;&lt;SPAN&gt;Sum&lt;/SPAN&gt;&lt;SPAN&gt;(Facts[Level])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; Countrylevel = &lt;/SPAN&gt;&lt;SPAN&gt;Sum&lt;/SPAN&gt;&lt;SPAN&gt;(Facts[Part of Country COL])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; Grouplevel = &lt;/SPAN&gt;&lt;SPAN&gt;Sum&lt;/SPAN&gt;&lt;SPAN&gt;(Facts[Part of Group COL])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;If&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;ISINSCOPE&lt;/SPAN&gt;&lt;SPAN&gt;(Facts[type]),Typelevel,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;If&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ISINSCOPE&lt;/SPAN&gt;&lt;SPAN&gt;(Facts[Country]),Countrylevel,Grouplevel))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;This gives the following view:&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;Problem solved (and found a typo in my dummy ;-))&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Dec 2022 18:10:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-total-Sum-in-Matrix-visual-with-complex/m-p/2968737#M99153</guid>
      <dc:creator>OliTFD</dc:creator>
      <dc:date>2022-12-14T18:10:08Z</dc:date>
    </item>
  </channel>
</rss>

