<?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: Divide two columns in a group by. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146569#M280</link>
    <description>&lt;P&gt;I think Mike has nailed it.. &amp;nbsp; I made a simple demo and made a calculated column and measure. &amp;nbsp;The column reprecates your what your seeing, but the measure actually meets your requirements.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Try remaking your calculation as a new measure:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike Carlo&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.PowerBI.Tips" target="_blank"&gt;www.PowerBI.Tips&lt;/A&gt;&lt;/P&gt;&lt;P&gt;mike@powerbi.tips&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2017 02:27:28 GMT</pubDate>
    <dc:creator>Mike_Carlo</dc:creator>
    <dc:date>2017-03-22T02:27:28Z</dc:date>
    <item>
      <title>Divide two columns in a group by.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/143387#M270</link>
      <description>&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Sorry, I know this seems so simple, but I can’t figure it out.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;In the following example, how do I take the [ListPriceExtended] and divide it by the [Qty] to get the [AverageListPrice] for each line?&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;The Qty and ListPriceExtended columns are Sum columns and we are grouping based on SKU.&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;My AverageListPrice is a measure with the following expression:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;AverageListPrice = SUM(MarkDownRaw[ListPriceExtended]) / SUM(MarkDownRaw[Qty])&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;However, the SUM statements are taking the sum of the full table, and not just the sum for each group by.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Here is the breakdown for SKU 70013.&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;The Sum of the ListPriceExtended is $334.48 and the Sum of the Qty is 46, so the AverageListPrice should be $334.48 / 46 for an average list price of $7.27.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&lt;img /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 23:10:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/143387#M270</guid>
      <dc:creator>mbhunt</dc:creator>
      <dc:date>2017-03-15T23:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two columns in a group by.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146524#M277</link>
      <description>&lt;P&gt;Your formula looks correct to me. &amp;nbsp;I imagine there must be other data Tables involved in that Table visual, with a missing or incorrect relationship?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 23:35:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146524#M277</guid>
      <dc:creator>mike_honey</dc:creator>
      <dc:date>2017-03-21T23:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two columns in a group by.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146527#M278</link>
      <description>&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So is "&lt;FONT face="Calibri"&gt;SUM&lt;/FONT&gt;" supposed to take the Sum of the entire table or just the group by section (which is what I want)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 23:46:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146527#M278</guid>
      <dc:creator>mbhunt</dc:creator>
      <dc:date>2017-03-21T23:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two columns in a group by.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146532#M279</link>
      <description>&lt;P&gt;I think I know where you went wrong - did you add&amp;nbsp;&lt;SPAN&gt;AverageListPrice as a "New measure" or a "New column"? &amp;nbsp;It looks like "New column", but it should likely be a "New measure".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 00:07:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146532#M279</guid>
      <dc:creator>mike_honey</dc:creator>
      <dc:date>2017-03-22T00:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two columns in a group by.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146569#M280</link>
      <description>&lt;P&gt;I think Mike has nailed it.. &amp;nbsp; I made a simple demo and made a calculated column and measure. &amp;nbsp;The column reprecates your what your seeing, but the measure actually meets your requirements.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Try remaking your calculation as a new measure:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike Carlo&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.PowerBI.Tips" target="_blank"&gt;www.PowerBI.Tips&lt;/A&gt;&lt;/P&gt;&lt;P&gt;mike@powerbi.tips&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 02:27:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146569#M280</guid>
      <dc:creator>Mike_Carlo</dc:creator>
      <dc:date>2017-03-22T02:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Divide two columns in a group by.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146880#M281</link>
      <description>&lt;P&gt;Looks good.&amp;nbsp; I think I got it.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 11:08:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Divide-two-columns-in-a-group-by/m-p/146880#M281</guid>
      <dc:creator>mbhunt</dc:creator>
      <dc:date>2017-03-22T11:08:10Z</dc:date>
    </item>
  </channel>
</rss>

