<?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: Calculating an agregated sum and adding a value to the sum in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941426#M97176</link>
    <description>&lt;P&gt;Additionally, I have added your formula to my work data (which is much larger, then test data) and there this measure does not calculate sums over product name. The result looks like this (for example for product A):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Value (A) = Value current month(A) + Sum(Values before month)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's obvious, I have a problem in data releationship, but I can't really track it.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 09:07:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-01T09:07:38Z</dc:date>
    <item>
      <title>Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2934554#M96637</link>
      <description>&lt;P&gt;Hi, I have the following problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of sales in current month for different products (let's say A, B, C):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table Name: Sales_current_mnth&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Product name&lt;/TD&gt;&lt;TD&gt;QTY&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;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;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;90&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 calculate a measure:&lt;/P&gt;&lt;P&gt;1) calculeate the sales numbers from the current month&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) sum the calculated values and the aggrgated from the prevous months&lt;/P&gt;&lt;P&gt;3) return a table with QTYs and values by product name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to calculate in DAX?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 05:33:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2934554#M96637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-29T05:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2935076#M96666</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Total QTY = SUM ( Sales_before_mnth[QTY] ) + SUM ( Sales_current_mnth[QTY] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Total Sales = SUM ( Sales_before_mnth[Value] ) + SUM ( Sales_current_mnth[Value] )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Nov 2022 08:44:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2935076#M96666</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-29T08:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941319#M97163</link>
      <description>&lt;P&gt;Thank you very much! Can you also advise, how I can create conditional measure? Let's say if Product Name = "A", then do calculation, else return 0. My 1st try was not successful:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Sales Conditional = IF(Sales_before_mnth[Product Name]="A", SUM ( Sales_before_mnth[Value] ) + &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt; ( Sales_current_mnth[Value] ), 0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Dec 2022 08:39:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941319#M97163</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-01T08:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941411#M97173</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Total Sales Conditional = 
IF ( 
    SELECTEDVALUE ( Sales_before_mnth[Product Name] ) = "A", 
    SUM ( Sales_before_mnth[Value] ) + SUM ( Sales_current_mnth[Value] ), 
    0
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 09:04:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941411#M97173</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-01T09:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941426#M97176</link>
      <description>&lt;P&gt;Additionally, I have added your formula to my work data (which is much larger, then test data) and there this measure does not calculate sums over product name. The result looks like this (for example for product A):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Value (A) = Value current month(A) + Sum(Values before month)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's obvious, I have a problem in data releationship, but I can't really track it.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 09:07:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941426#M97176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-01T09:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941464#M97180</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Make sure the product names in both tables have exactly the same splilling. Adiitionally in order to have correct totals please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Total Sales Conditional =
SUMX (
    VALUES ( Sales_before_mnth[Product Name] ),
    IF (
        Sales_before_mnth[Product Name] = "A",
        CALCULATE (
            SUM ( Sales_before_mnth[Value] ) + SUM ( Sales_current_mnth[Value] )
        ),
        0
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Dec 2022 09:18:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941464#M97180</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-01T09:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941555#M97186</link>
      <description>&lt;P&gt;Hi, it looks that if there is a new product name is added to the current mnth table then the formula calculeats total of the sales_before_month, e.g. if there is a new product D added:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Product name&lt;/TD&gt;&lt;TD&gt;QTY&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;5&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;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I get the total (formula does not find D in the&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;Sales_before_mnth). So how can I handle the exception in this case?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 09:44:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941555#M97186</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-01T09:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating an agregated sum and adding a value to the sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941723#M97199</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="direction: ltr;"&gt;please try by activating bi-directional relationship and slice by&amp;nbsp;Sales_current_mnth[Product Name] the formula would be&lt;/P&gt;
&lt;P style="direction: ltr;"&gt;Total Sales Conditional =&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( Sales_current_mnth[Product Name] ),&lt;BR /&gt;IF (&lt;BR /&gt;Sales_current_mnth[Product Name] = "A",&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Sales_before_mnth[Value] ) + SUM ( Sales_current_mnth[Value] )&lt;BR /&gt;),&lt;BR /&gt;0&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P style="direction: ltr;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 10:47:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-an-agregated-sum-and-adding-a-value-to-the-sum/m-p/2941723#M97199</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-12-01T10:47:18Z</dc:date>
    </item>
  </channel>
</rss>

