<?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 Multiply multiple rows with a single value in another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/803204#M4902</link>
    <description>&lt;P&gt;All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate a yield. Take the following example. I have a table where I have sales data per SKU per month (Table_sales). Several SKU's are linked to a single asset. The relation between the asset and SKU's in maintained in a seperate table (Table_Asset). Next to this I have a table that contains some key metrics on the assets like a loss percentage (Table_Asset_Metric). Table_Asset and Table_Asset_Metric are linked to eachother.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate to calculate the amount of assets I'm losing based on the sales.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SKU A 2000 sold in month 1 --&amp;gt; SKU A is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;SKU A 3000 sold in month 2 --&amp;gt;&amp;nbsp;SKU A is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;SKU B 1000 sold in month 1 --&amp;gt; SKU B is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;SKU B 2000 sold in month 2 --&amp;gt; SKU B is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Per shipment of Asset XYZ I have loss of 2%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate the total amount of asset XYZ I'm losing. In excel I would calculate like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Loss asset XYZ = ( total volume SKU A + total volume SKU B) * Asset loss per shipment = (2000 + 3000 + 1000+ 2000) * 2% = 160&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table sales:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SKU Month&amp;nbsp; volume&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;500&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table_Asset&lt;/P&gt;&lt;P&gt;SKU&amp;nbsp; &amp;nbsp; &amp;nbsp; Asset&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XYZ&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XYZ&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table_Asset_Metric&lt;/P&gt;&lt;P&gt;Asset&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Losses%&lt;/P&gt;&lt;P&gt;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2%&lt;/P&gt;&lt;P&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 14:55:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-26T14:55:34Z</dc:date>
    <item>
      <title>Multiply multiple rows with a single value in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/803204#M4902</link>
      <description>&lt;P&gt;All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate a yield. Take the following example. I have a table where I have sales data per SKU per month (Table_sales). Several SKU's are linked to a single asset. The relation between the asset and SKU's in maintained in a seperate table (Table_Asset). Next to this I have a table that contains some key metrics on the assets like a loss percentage (Table_Asset_Metric). Table_Asset and Table_Asset_Metric are linked to eachother.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate to calculate the amount of assets I'm losing based on the sales.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SKU A 2000 sold in month 1 --&amp;gt; SKU A is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;SKU A 3000 sold in month 2 --&amp;gt;&amp;nbsp;SKU A is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;SKU B 1000 sold in month 1 --&amp;gt; SKU B is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;SKU B 2000 sold in month 2 --&amp;gt; SKU B is shipped in Asset XYZ&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Per shipment of Asset XYZ I have loss of 2%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to calculate the total amount of asset XYZ I'm losing. In excel I would calculate like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Loss asset XYZ = ( total volume SKU A + total volume SKU B) * Asset loss per shipment = (2000 + 3000 + 1000+ 2000) * 2% = 160&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table sales:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SKU Month&amp;nbsp; volume&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2000&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;500&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table_Asset&lt;/P&gt;&lt;P&gt;SKU&amp;nbsp; &amp;nbsp; &amp;nbsp; Asset&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XYZ&lt;/P&gt;&lt;P&gt;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XYZ&lt;/P&gt;&lt;P&gt;C&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 123&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table_Asset_Metric&lt;/P&gt;&lt;P&gt;Asset&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Losses%&lt;/P&gt;&lt;P&gt;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2%&lt;/P&gt;&lt;P&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 14:55:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/803204#M4902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-26T14:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply multiple rows with a single value in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/804329#M4934</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Is this what you are looking for in your question?&lt;/P&gt;&lt;P&gt;If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Fri, 27 Sep 2019 13:27:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/804329#M4934</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-09-27T13:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply multiple rows with a single value in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/804470#M4939</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the PBIX&amp;nbsp;&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AgCd7AyfqZtExi4ZlrJckGl8eUiw?e=KvGMIW" target="_blank" rel="noopener"&gt;SKU&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This was pretty straightforward with your good explanation. Thank you. However when I added the filters, I realized that one would need a weighted average loss dollar amount if there were more than 1 loss percentage. (i.e. select A and C ) So that was interesting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.&lt;BR /&gt;Nathaniel&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Total Sales for Selected SKU = CALCULATE(SUM(Sales[Volume]),ALLSELECTED(Sales[SKU]))

sumx(sales,Sales[Volume] * [Losses per Asset Carrier All Selected])

Percentage Loss = Divide([Total Losses],[Total Sales for Selected SKU])


Losses per Asset Carrier All Selected = CALCULATE(AVERAGE(ASSET_METRIC[Losses%]),Filter(Sales,Sales[SKU]=(Sales[SKU])))&lt;/PRE&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;</description>
      <pubDate>Fri, 27 Sep 2019 15:19:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/804470#M4939</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-09-27T15:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply multiple rows with a single value in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/810148#M5180</link>
      <description>&lt;P&gt;Thanks a lot Nathaniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to work!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Excellent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 17:30:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/810148#M5180</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-04T17:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply multiple rows with a single value in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/811007#M5218</link>
      <description>&lt;P&gt;hi Nathaniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got an additional challenge. ;-) Assume that I add in the example above a column to the table with the losses. I would the column year. In this case I would insert a loss % value for 2018 and another row with a value for 2019. How should I calculate in this case the same but taking e.g. the loss for 2019 only.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 07:33:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/811007#M5218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-07T07:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiply multiple rows with a single value in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/811744#M5250</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Can't add years to this table.&lt;/P&gt;&lt;P&gt;Nathaniel&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>Mon, 07 Oct 2019 22:17:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiply-multiple-rows-with-a-single-value-in-another-table/m-p/811744#M5250</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-07T22:17:37Z</dc:date>
    </item>
  </channel>
</rss>

