<?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: Row by row multiplication - how to get the correct sum in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955341#M10919</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="202416" data-lia-user-login="1up" class="lia-mention lia-mention-user"&gt;1up&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll want to wrap the original calc in a sumx...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sales_Uncleaned&lt;/SPAN&gt;:=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="3"&gt;SUMX (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;SPAN&gt;Combined&lt;/SPAN&gt;',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIVIDE(max('&lt;SPAN&gt;Combined&lt;/SPAN&gt;'[&lt;SPAN&gt;Sales_2019&lt;/SPAN&gt;]),max('&lt;SPAN&gt;Combined&lt;/SPAN&gt;'[&lt;SPAN&gt;Potential_2019&lt;/SPAN&gt;]))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;You may have to modify the query a bit as I am not sure what your original table looks like.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 14:03:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-02T14:03:46Z</dc:date>
    <item>
      <title>Row by row multiplication - how to get the correct sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955287#M10916</link>
      <description>&lt;P&gt;So again I am trying to do row by row multiplicaiton using measures, and I end up with the wrong sum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first expression below, Sales_Uncleaned, all seems to work, the correct sum is achieved, on total and on all aggregated categories.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;Sales_Uncleaned = Divide(Maxx(RELATEDTABLE(Combined);Combined[Sales_2019]) ;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Maxx(RELATEDTABLE(Combined);Combined[Potential_2019]))&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In the second step I want to multiply the first expression with a factor to get the Sales_Cleaned;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sales_Cleaned = [Sales_Uncleaned] * Combined[Factor]&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (Written in 'Pseudocode')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have tried using Maxx, Sumx and the values get way high. I am using % in this case for Sales_Uncleaned, and while the first expression generates double digit figures, after multiplication, I get three digit ones for example, expected is slightly lower percentages. It all works when looking at the data in a table format, at a lowest level category. But when I look at an aggregated category, or on a total, that is when the sums go crazy. So since the factor is less than 1 that I want to multiply with, the lower percentages on the right look OK! However, the total is way off, and on aggreagated sales categories, it is also way off.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&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;&lt;SPAN&gt;All fields are in one and the same Table. Don't know if the relation model is needed in this case, otherwise please let me know.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Would be much appreciating for help on the way.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Mar 2020 13:29:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955287#M10916</guid>
      <dc:creator>1up</dc:creator>
      <dc:date>2020-03-02T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row multiplication - how to get the correct sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955341#M10919</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="202416" data-lia-user-login="1up" class="lia-mention lia-mention-user"&gt;1up&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll want to wrap the original calc in a sumx...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sales_Uncleaned&lt;/SPAN&gt;:=&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="3"&gt;SUMX (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&lt;SPAN&gt;Combined&lt;/SPAN&gt;',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIVIDE(max('&lt;SPAN&gt;Combined&lt;/SPAN&gt;'[&lt;SPAN&gt;Sales_2019&lt;/SPAN&gt;]),max('&lt;SPAN&gt;Combined&lt;/SPAN&gt;'[&lt;SPAN&gt;Potential_2019&lt;/SPAN&gt;]))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;You may have to modify the query a bit as I am not sure what your original table looks like.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 14:03:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955341#M10919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T14:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row multiplication - how to get the correct sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955425#M10926</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried, and I get wrong sums unfortunately for the starting expression, using this code. Now the %-ages are in the thousands. On individual base category it works though. I wrote as below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sales_Uncleaned = Sumx(Combined;Divide(Max(Combined[Sales_2019]); Max(Combined[Potential_2019])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I omit 'Sumx' , then it seem to summarize correctly, even on higher aggregate category-level. I am confused how this really works...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any further ideas?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Mar 2020 15:13:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955425#M10926</guid>
      <dc:creator>1up</dc:creator>
      <dc:date>2020-03-02T15:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Row by row multiplication - how to get the correct sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955461#M10928</link>
      <description>&lt;P&gt;Perhaps I should add, I have two categories in the table. One column is a unique category, let's call them A, B, C, D, E etc. The other one is a group which includes certain categories, so let's say Cat1 includes (A, C), Cat2 includes (B, D, E).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Summarizing on the aggregated Cat#-categories, gives the wrong result, and on total sum...&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 15:36:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Row-by-row-multiplication-how-to-get-the-correct-sum/m-p/955461#M10928</guid>
      <dc:creator>1up</dc:creator>
      <dc:date>2020-03-02T15:36:28Z</dc:date>
    </item>
  </channel>
</rss>

