<?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: DAX measure to sum up product sales and divide in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2706773#M82094</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="388250" data-lia-user-login="OCBB_SFAFPandA" class="lia-mention lia-mention-user"&gt;OCBB_SFAFPandA&lt;/a&gt;&amp;nbsp;Right, so if you are using the Product column from the Fact Sales table in your visual, then the rows in that table are already being filtered down to that Product in the context of the visualization. So, no need to use SUMX/AVERAGEX where you include a FILTER clause like is being done in the Sold calculation.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2022 13:17:05 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2022-08-17T13:17:05Z</dc:date>
    <item>
      <title>DAX measure to sum up product sales and divide</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2704002#M81951</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 separate FACTS tables, and do not have a dimension table to link the categories. I tried to manually create the relationship, but it would be many-to-many and would probably slow down the model. How can I create a measure for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Facts Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;110&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Facts Qty sold&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Sold&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to have a measure that sums all the product A (assume the tables are only for 1 day) and divide by Product A quantity sold.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the table I am trying to make is&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Avg sale&lt;/TD&gt;&lt;TD&gt;Prod A Sales / Prod B qty&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 16 Aug 2022 17:06:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2704002#M81951</guid>
      <dc:creator>OCBB_SFAFPandA</dc:creator>
      <dc:date>2022-08-16T17:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to sum up product sales and divide</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2704030#M81954</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="388250" data-lia-user-login="OCBB_SFAFPandA" class="lia-mention lia-mention-user"&gt;OCBB_SFAFPandA&lt;/a&gt;&amp;nbsp;Not sure if all the information is there but perhaps something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
  VAR __Product = MAX('Facts Sales'[Product])
  VAR __Sales = AVERAGE('Facts Sales'[Sales])
  VAR __Sold = SUMX(FILTER('Facts Qty sold',[Product] = __Product),[Sold])
RETURN
  DIVIDE(__Sales, __Sold,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Aug 2022 17:19:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2704030#M81954</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-08-16T17:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to sum up product sales and divide</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2704631#M81986</link>
      <description>&lt;P&gt;Thanks this works &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;! needed the sum instead of the avg, so just fixed it. Just so I understand, the reason we don't use sumx( or avgx) for the sales category is because it will be redundant if we are already filtering the product by the quantity sold expression?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 23:50:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2704631#M81986</guid>
      <dc:creator>OCBB_SFAFPandA</dc:creator>
      <dc:date>2022-08-16T23:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure to sum up product sales and divide</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2706773#M82094</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="388250" data-lia-user-login="OCBB_SFAFPandA" class="lia-mention lia-mention-user"&gt;OCBB_SFAFPandA&lt;/a&gt;&amp;nbsp;Right, so if you are using the Product column from the Fact Sales table in your visual, then the rows in that table are already being filtered down to that Product in the context of the visualization. So, no need to use SUMX/AVERAGEX where you include a FILTER clause like is being done in the Sold calculation.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 13:17:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-to-sum-up-product-sales-and-divide/m-p/2706773#M82094</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-08-17T13:17:05Z</dc:date>
    </item>
  </channel>
</rss>

