<?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: Spread whit DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581292#M138147</link>
    <description>&lt;P&gt;&lt;SPAN&gt;you can achieve this by creating a new column that calculates the allocated cost for each product. Assuming your table is named &lt;/SPAN&gt;YourTableName&lt;SPAN&gt;, you can use the following DAX formula:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AllocatedCost =&lt;BR /&gt;VAR TotalCostWithoutProduct = CALCULATE(SUM(YourTableName[Cost]), FILTER(YourTableName, YourTableName[Product] = BLANK()))&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;NOT(ISBLANK(YourTableName[Product])),&lt;BR /&gt;YourTableName[Cost],&lt;BR /&gt;YourTableName[Cost] * (YourTableName[Import] / TotalCostWithoutProduct)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This formula creates a new column called AllocatedCost. It calculates the total cost without a specified product for each UniqueDutyNumber using the TotalCostWithoutProduct variable. Then, for each row in the table, it checks if the product is specified. If it is, it simply uses the original cost. If not, it allocates the cost based on the proportion of the product's import value compared to the total cost without a specified product.&lt;/P&gt;&lt;P&gt;Please replace YourTableName with the actual name of your table.&lt;/P&gt;&lt;P&gt;Note: This formula assumes that the import value is used as the allocation factor. You may need to adjust it based on your specific allocation criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Dec 2023 07:25:09 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2023-12-13T07:25:09Z</dc:date>
    <item>
      <title>Spread whit DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581167#M138137</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have wants again a question to the DAX-Specialist. I have a table whit Product and Cost. Furthermore Cost whitout Product but the same UniqueDutyNumber. I will now spread the Cost whitout Product on the Product whit the same UniqueDutyNumber. See Example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We can i to that in DAX?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;UniqueDutyNumber&lt;/TD&gt;&lt;TD&gt;OrderNo&lt;/TD&gt;&lt;TD&gt;Order-Nr.&lt;/TD&gt;&lt;TD&gt;Import&lt;/TD&gt;&lt;TD&gt;Export&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Solution&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;343299&lt;/TD&gt;&lt;TD&gt;Cola&lt;/TD&gt;&lt;TD&gt;43111&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;102&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;47%&lt;/T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TD&gt;&lt;TD&gt;100.25&lt;/TD&gt;&lt;TD&gt;9.6&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;3%&lt;/TD&gt;&lt;TD&gt;2.8443919&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;387889&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;63&lt;/TD&gt;&lt;TD&gt;0&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;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks, BR Simon&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 07:58:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581167#M138137</guid>
      <dc:creator>Simon_Br</dc:creator>
      <dc:date>2023-12-13T07:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Spread whit DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581292#M138147</link>
      <description>&lt;P&gt;&lt;SPAN&gt;you can achieve this by creating a new column that calculates the allocated cost for each product. Assuming your table is named &lt;/SPAN&gt;YourTableName&lt;SPAN&gt;, you can use the following DAX formula:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AllocatedCost =&lt;BR /&gt;VAR TotalCostWithoutProduct = CALCULATE(SUM(YourTableName[Cost]), FILTER(YourTableName, YourTableName[Product] = BLANK()))&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;NOT(ISBLANK(YourTableName[Product])),&lt;BR /&gt;YourTableName[Cost],&lt;BR /&gt;YourTableName[Cost] * (YourTableName[Import] / TotalCostWithoutProduct)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This formula creates a new column called AllocatedCost. It calculates the total cost without a specified product for each UniqueDutyNumber using the TotalCostWithoutProduct variable. Then, for each row in the table, it checks if the product is specified. If it is, it simply uses the original cost. If not, it allocates the cost based on the proportion of the product's import value compared to the total cost without a specified product.&lt;/P&gt;&lt;P&gt;Please replace YourTableName with the actual name of your table.&lt;/P&gt;&lt;P&gt;Note: This formula assumes that the import value is used as the allocation factor. You may need to adjust it based on your specific allocation criteria.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 07:25:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581292#M138147</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-12-13T07:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Spread whit DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581340#M138150</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the answer. Can you make the formula whit my columne-name?&lt;/P&gt;&lt;P&gt;I have edit the uniquenumber, then this is the key for the spread.&lt;/P&gt;&lt;P&gt;BR Simon&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 07:59:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3581340#M138150</guid>
      <dc:creator>Simon_Br</dc:creator>
      <dc:date>2023-12-13T07:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Spread whit DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3583442#M138252</link>
      <description>&lt;P&gt;Unfortunately, this does not work as desired. The total value is created with all costs and by unique number. The ratio of export costs per UniqueNumber is also not created. Can anyone help me? I am very thankful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards, Simon&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 08:09:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Spread-whit-DAX/m-p/3583442#M138252</guid>
      <dc:creator>Simon_Br</dc:creator>
      <dc:date>2023-12-14T08:09:38Z</dc:date>
    </item>
  </channel>
</rss>

