<?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: Weekly Cost - Sum instead of result of DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4664191#M178629</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;daily cost old: = 
SWITCH (
    TRUE (),
    HASONEVALUE ( fruit[fruit] ), SUMX ( VALUES ( 'calendar'[date] ), CALCULATE ( MAX ( data[cost] ) ) ),
    SUMX (
        VALUES ( 'calendar'[date] ),
        CALCULATE ( MAX ( data[cost] ), ALL ( fruit[fruit] ) )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;daily cost new (weighted cost): = 
SUMX (
    VALUES ( 'calendar'[date] ),
    SUMX (
        SUMMARIZE ( data, fruit[fruit] ),
        CALCULATE (
            DIVIDE (
                SUM ( data[weight] ),
                CALCULATE ( SUM ( data[weight] ), ALL ( fruit[fruit] ) )
            )
                * SUM ( data[cost] )
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;All cost: = 
[daily cost old:] + [daily cost new (weighted cost):]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2025 03:42:47 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2025-04-23T03:42:47Z</dc:date>
    <item>
      <title>Weekly Cost - Sum instead of result of DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4664078#M178624</link>
      <description>&lt;P&gt;We need help in computing the weekly cost of each fruit, but needs to recompute it if both fruits are harvested on the same day.&lt;BR /&gt;Sample April 15 (highlighted in yellow),&amp;nbsp;Fruit 1 and Fruit 2 both have the same cost of 4600 for this day but have different weight.&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;We are able to compute the new cost however we want the total to be the sum of the new cost + existing cost not the output by the new cost as seen in the right most part of the photo.&lt;BR /&gt;&lt;BR /&gt;Any tips on how to compute this please.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 01:43:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4664078#M178624</guid>
      <dc:creator>non23</dc:creator>
      <dc:date>2025-04-23T01:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly Cost - Sum instead of result of DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4664191#M178629</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;daily cost old: = 
SWITCH (
    TRUE (),
    HASONEVALUE ( fruit[fruit] ), SUMX ( VALUES ( 'calendar'[date] ), CALCULATE ( MAX ( data[cost] ) ) ),
    SUMX (
        VALUES ( 'calendar'[date] ),
        CALCULATE ( MAX ( data[cost] ), ALL ( fruit[fruit] ) )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;daily cost new (weighted cost): = 
SUMX (
    VALUES ( 'calendar'[date] ),
    SUMX (
        SUMMARIZE ( data, fruit[fruit] ),
        CALCULATE (
            DIVIDE (
                SUM ( data[weight] ),
                CALCULATE ( SUM ( data[weight] ), ALL ( fruit[fruit] ) )
            )
                * SUM ( data[cost] )
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;All cost: = 
[daily cost old:] + [daily cost new (weighted cost):]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 03:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4664191#M178629</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2025-04-23T03:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly Cost - Sum instead of result of DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4670180#M178879</link>
      <description>&lt;P&gt;Thankyou&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;for providing the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="760814" data-lia-user-login="non23" class="lia-mention lia-mention-user"&gt;non23&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?&lt;/P&gt;
&lt;P&gt;If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/P&gt;
&lt;P&gt;Chaithanya.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 07:28:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4670180#M178879</guid>
      <dc:creator>v-kathullac</dc:creator>
      <dc:date>2025-04-28T07:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Weekly Cost - Sum instead of result of DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4673742#M178998</link>
      <description>&lt;P&gt;Thankyou&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/291628" target="_blank"&gt;@Jihwan_Kim&lt;/A&gt;&amp;nbsp;for providing the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/760814" target="_blank"&gt;@non23&lt;/A&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?&lt;/P&gt;
&lt;P&gt;If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/P&gt;
&lt;P&gt;Chaithanya.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Apr 2025 03:27:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weekly-Cost-Sum-instead-of-result-of-DAX/m-p/4673742#M178998</guid>
      <dc:creator>v-kathullac</dc:creator>
      <dc:date>2025-04-30T03:27:56Z</dc:date>
    </item>
  </channel>
</rss>

