<?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: Multiply rows within same table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769465#M86148</link>
    <description>&lt;P&gt;Hi, this is the result I expect. However, I would need to define up to 30 variables (as examples B and C in your example). Would there be a different way to do it? Variable A is ok and should always be used to multiply B, C, D, E...&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 07:49:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-09-15T07:49:32Z</dc:date>
    <item>
      <title>Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768092#M86048</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should a measure be written where each row in a table should be multiplied with a specific row from same table. In this simplified table B and C should be multiplied with A. And the column subtotals should add up correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Code&lt;/TD&gt;&lt;TD&gt;1/2022&lt;/TD&gt;&lt;TD&gt;2/2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A x B =&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;1200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A x C =&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;TD&gt;2400&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 14 Sep 2022 18:48:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768092#M86048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-14T18:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768254#M86064</link>
      <description>&lt;P&gt;I managed to get the multiplying to work, now I am just struggeling with the column subtotals, I need the subtotal to add up all the results,&amp;nbsp; not price x volume . This seems to be a commin problem with 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;</description>
      <pubDate>Wed, 14 Sep 2022 20:27:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768254#M86064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-14T20:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768516#M86079</link>
      <description>&lt;P&gt;Do you want to sum Result column?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 00:40:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768516#M86079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T00:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768626#M86091</link>
      <description>&lt;P&gt;Yes, I want to sum the results from the all individual months, I do not want the column subtotal to be calculated as [price] x [volume].&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 01:52:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768626#M86091</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T01:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768656#M86094</link>
      <description>&lt;P&gt;where are the months. i only can see december&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 02:05:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768656#M86094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T02:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768664#M86095</link>
      <description>&lt;P&gt;How did you format your table like that. that combinated headers?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 02:06:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768664#M86095</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T02:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768749#M86099</link>
      <description>&lt;P&gt;That was just a snapshot, here are&lt;/P&gt;&lt;P&gt;4 months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 02:28:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2768749#M86099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T02:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769072#M86114</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This function controls the output of Total.&lt;BR /&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;HASONEVALUE(Columns), Value, Total).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sample data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
Var _A=CALCULATE(SUM('Table'[Price]),FILTER(ALL('Table'),[Code]="A"&amp;amp;&amp;amp;[Date]=SELECTEDVALUE('Table'[Date])))
Var _B=CALCULATE(SUM('Table'[Price]),FILTER(ALL('Table'),[Code]="B"&amp;amp;&amp;amp;[Date]=SELECTEDVALUE('Table'[Date])))
Var _C=CALCULATE(SUM('Table'[Price]),FILTER(ALL('Table'),[Code]="C"&amp;amp;&amp;amp;[Date]=SELECTEDVALUE('Table'[Date])))
Return
IF(SELECTEDVALUE('Table'[Code])="A",BLANK(),IF(SELECTEDVALUE('Table'[Code])="B",_A*_B,_A*_C))&lt;/LI-CODE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total = IF(HASONEVALUE('Table'[Date]),[Measure],SUM('Table'[Price]))&lt;/LI-CODE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Hope this function is applied to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 06:01:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769072#M86114</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-09-15T06:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769149#M86118</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your input, maybe with some modification your solution might work. In the result matrix I would need these sums:&lt;BR /&gt;&lt;BR /&gt;B 1000+1200 = 1200&lt;BR /&gt;C 2000+2400 = 4400&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 06:22:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769149#M86118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T06:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769320#M86127</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Measure:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total = IF(HASONEVALUE('Table'[Date]),[Measure],SUMX('Table',[Measure]))&lt;/LI-CODE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Is this the result you expect?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 07:02:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769320#M86127</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-09-15T07:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply rows within same table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769465#M86148</link>
      <description>&lt;P&gt;Hi, this is the result I expect. However, I would need to define up to 30 variables (as examples B and C in your example). Would there be a different way to do it? Variable A is ok and should always be used to multiply B, C, D, E...&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 07:49:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-rows-within-same-table/m-p/2769465#M86148</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-15T07:49:32Z</dc:date>
    </item>
  </channel>
</rss>

