<?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 Measure Subtotals in Matrix not working for both Rows and Columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/941296#M10045</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added this Measure in a Matrix, which &lt;SPAN&gt;calculates the transactions volume by hour&lt;/SPAN&gt;:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Transactions = AVERAGE(table1[percentage_by_hour]) * sum(table2[transaction_value])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"table1" has the percentage distribution of transactions by hour, as shown below:&lt;/P&gt;&lt;P&gt;hour &amp;nbsp; % &amp;nbsp; channel&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1% &amp;nbsp; Channel A&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2% &amp;nbsp; Channel B&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; 8% &amp;nbsp; Channel A&lt;/P&gt;&lt;P&gt;... &amp;nbsp; &amp;nbsp;&amp;nbsp; .... &amp;nbsp; &amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"table2" has the total volume of transactions for the day, by Channel:&lt;/P&gt;&lt;P&gt;day &amp;nbsp; &amp;nbsp;&amp;nbsp; channel &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; transaction_volume&lt;/P&gt;&lt;P&gt;feb 1 &amp;nbsp;&amp;nbsp; Channel A &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;feb 2 &amp;nbsp;&amp;nbsp; Channel B &amp;nbsp; &amp;nbsp;&amp;nbsp; 40&lt;/P&gt;&lt;P&gt;... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Matrix has 'Hours' in the columns and 'Channels' in the rows and for some reasons only either the rows subtotal or columns subtotal is showing correctly, but not both together. This is the Measure that I used in the Matrix to show results:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Transactions NEW = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR monthlyAverages = AVERAGEX(VALUES(table2[Channel]),[Total Transactions]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR AverageTotal = summarize(table2,table2[Channel],"Monthly AVG",monthlyAverages)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(HASONEVALUE(table2[Channel]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;monthlyAverages,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sumx(AverageTotal,[Monthly AVG]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is working by 'Channel', therefore the rows subtotal is correct, but the columns subtotal is wrong.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I replace 'Channel' with 'Hour' the opposite will happen (&lt;SPAN&gt;columns subtotal is correct, and rows subtotal is wrong&lt;/SPAN&gt;).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How can I make it work so both rows subtotal and columns subtotal show correctly?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 20 Feb 2020 17:11:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-20T17:11:36Z</dc:date>
    <item>
      <title>Measure Subtotals in Matrix not working for both Rows and Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/941296#M10045</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added this Measure in a Matrix, which &lt;SPAN&gt;calculates the transactions volume by hour&lt;/SPAN&gt;:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Transactions = AVERAGE(table1[percentage_by_hour]) * sum(table2[transaction_value])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"table1" has the percentage distribution of transactions by hour, as shown below:&lt;/P&gt;&lt;P&gt;hour &amp;nbsp; % &amp;nbsp; channel&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1% &amp;nbsp; Channel A&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2% &amp;nbsp; Channel B&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; 8% &amp;nbsp; Channel A&lt;/P&gt;&lt;P&gt;... &amp;nbsp; &amp;nbsp;&amp;nbsp; .... &amp;nbsp; &amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"table2" has the total volume of transactions for the day, by Channel:&lt;/P&gt;&lt;P&gt;day &amp;nbsp; &amp;nbsp;&amp;nbsp; channel &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; transaction_volume&lt;/P&gt;&lt;P&gt;feb 1 &amp;nbsp;&amp;nbsp; Channel A &amp;nbsp; &amp;nbsp; 100&lt;/P&gt;&lt;P&gt;feb 2 &amp;nbsp;&amp;nbsp; Channel B &amp;nbsp; &amp;nbsp;&amp;nbsp; 40&lt;/P&gt;&lt;P&gt;... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Matrix has 'Hours' in the columns and 'Channels' in the rows and for some reasons only either the rows subtotal or columns subtotal is showing correctly, but not both together. This is the Measure that I used in the Matrix to show results:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Transactions NEW = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR monthlyAverages = AVERAGEX(VALUES(table2[Channel]),[Total Transactions]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR AverageTotal = summarize(table2,table2[Channel],"Monthly AVG",monthlyAverages)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(HASONEVALUE(table2[Channel]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;monthlyAverages,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;sumx(AverageTotal,[Monthly AVG]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is working by 'Channel', therefore the rows subtotal is correct, but the columns subtotal is wrong.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I replace 'Channel' with 'Hour' the opposite will happen (&lt;SPAN&gt;columns subtotal is correct, and rows subtotal is wrong&lt;/SPAN&gt;).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How can I make it work so both rows subtotal and columns subtotal show correctly?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 20 Feb 2020 17:11:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/941296#M10045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-20T17:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Subtotals in Matrix not working for both Rows and Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/943934#M10175</link>
      <description>You don't understand how variables in DAX work. Please try to do some reading on this. A hint is this: a variable is calculated only once at the point of its definition.</description>
      <pubDate>Sat, 22 Feb 2020 17:58:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/943934#M10175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-22T17:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Subtotals in Matrix not working for both Rows and Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/944062#M10202</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;The Total calculation does precisely what you asked it to do, namely calculate the average for the day.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;What you actually want to see, if I am not mistaken, is the sum of the hourly averages. In order to calculate this you need to calculate the hourly values again and then sum them into the required total.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Something like (depends also in the relations present):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SUMX(&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;summarize&lt;/SPAN&gt;(&lt;SPAN&gt;'table2'&lt;/SPAN&gt;,&lt;BR /&gt;&lt;SPAN&gt;table2[Channel],&lt;BR /&gt;table1[Hour],&lt;BR /&gt;"Monthly AVG",monthlyAverages&lt;/SPAN&gt;&lt;BR /&gt;),&lt;BR /&gt;&lt;SPAN&gt;[Monthly AVG])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;replace&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;sumx(AverageTotal,[Monthly AVG])&lt;/STRONG&gt; with the above code snippet&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jan&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;if this is a solution for you, don't forget to mark it as such. thanks&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 10:18:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/944062#M10202</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-23T10:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Subtotals in Matrix not working for both Rows and Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/944145#M10208</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure why you're using AVERAGE... I think this is not what you should do. Have a look at this model and the calculation. I think this might be what you really want...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://1drv.ms/x/s!ApyQEauTSLtOgYJNmDbSzQj8jbcu-A?e=WgQjNU" target="_blank"&gt;https://1drv.ms/x/s!ApyQEauTSLtOgYJNmDbSzQj8jbcu-A?e=WgQjNU&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 14:24:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/944145#M10208</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-23T14:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Subtotals in Matrix not working for both Rows and Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/945423#M10297</link>
      <description>&lt;P&gt;thanks Anonymous&lt;/LI-USER&gt; , but unfortunately this won't work as I cannot have fields from different tables in the Summarize function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anonymous&lt;/LI-USER&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:44:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/945423#M10297</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T15:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measure Subtotals in Matrix not working for both Rows and Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/945454#M10304</link>
      <description>Anonymous&lt;/LI-USER&gt;, please download the Excel file and open the PowerPivot model. You'll then see how it's structured and the measure you want.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 24 Feb 2020 15:53:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-Subtotals-in-Matrix-not-working-for-both-Rows-and/m-p/945454#M10304</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-24T15:53:37Z</dc:date>
    </item>
  </channel>
</rss>

