<?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: Trend line by calculating custom summation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3908156#M152238</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="740414" data-lia-user-login="pbinewbie47" class="lia-mention lia-mention-user"&gt;pbinewbie47&lt;/a&gt;&amp;nbsp; try below measure and let us know what happened.&amp;nbsp;&lt;BR /&gt;Final Count =&lt;BR /&gt;VAR CurrentOrderNo = 'YourTable'[Order_No]&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Order_No] &amp;lt;= CurrentOrderNo&lt;BR /&gt;),&lt;BR /&gt;'YourTable'[count]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2024 09:49:15 GMT</pubDate>
    <dc:creator>johnbasha33</dc:creator>
    <dc:date>2024-05-10T09:49:15Z</dc:date>
    <item>
      <title>Trend line by calculating custom summation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3906806#M152199</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have table that looks like :&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Order_No&lt;/TD&gt;&lt;TD&gt;count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;104&lt;/TD&gt;&lt;TD&gt;55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;110&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;115&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;116&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;135&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;140&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I want to plot a trend of count vs Order no. as the final goal. So for each order no., it looks at the entry in the table for each unit before that order no. (smaller than current order no.). Adds the value of count for each unit, and that becomes the count to plot the trend. My final table to plot the data should look something like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Final count&lt;/TD&gt;&lt;TD&gt;Order no&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;45 + 0 + 0&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(45 + 55 + 0)&lt;/TD&gt;&lt;TD&gt;104&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(45 + 55 + 25)&lt;/TD&gt;&lt;TD&gt;110&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(45 + 55 + 20)&lt;/TD&gt;&lt;TD&gt;115&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(40 + 55 + 20)&lt;/TD&gt;&lt;TD&gt;116&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(40 + 30 + 20)&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(40 + 30 + 10)&lt;/TD&gt;&lt;TD&gt;135&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;(40 + 15 + 10)&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;140&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;How can I write DAX measure for the final count? TIA.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 01:23:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3906806#M152199</guid>
      <dc:creator>pbinewbie47</dc:creator>
      <dc:date>2024-05-10T01:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line by calculating custom summation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3908156#M152238</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="740414" data-lia-user-login="pbinewbie47" class="lia-mention lia-mention-user"&gt;pbinewbie47&lt;/a&gt;&amp;nbsp; try below measure and let us know what happened.&amp;nbsp;&lt;BR /&gt;Final Count =&lt;BR /&gt;VAR CurrentOrderNo = 'YourTable'[Order_No]&lt;BR /&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;FILTER(&lt;BR /&gt;'YourTable',&lt;BR /&gt;'YourTable'[Order_No] &amp;lt;= CurrentOrderNo&lt;BR /&gt;),&lt;BR /&gt;'YourTable'[count]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 09:49:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3908156#M152238</guid>
      <dc:creator>johnbasha33</dc:creator>
      <dc:date>2024-05-10T09:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line by calculating custom summation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3908905#M152248</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="740414" data-lia-user-login="pbinewbie47" class="lia-mention lia-mention-user"&gt;pbinewbie47&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the example data I used:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try the following DAX expressions:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR _table =
    SUMMARIZE (
        'Table',
        'Table'[Order_No],
        "final count",
            CALCULATE (
                SUM ( 'Table'[count] ),
                FILTER ( ALL ( 'Table' ), 'Table'[Order_No] &amp;lt;= EARLIER ( 'Table'[Order_No] ) )
            )
    )
VAR _current_No =
    SELECTEDVALUE ( 'Table'[Order_No] )
RETURN
    SUMX ( FILTER ( _table, 'Table'[Order_No] = _current_No ), [final count] )&lt;/LI-CODE&gt;&lt;P&gt;The results are as follows:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In addition, you can use the calculation table shown below:&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;Best Regards,&lt;/P&gt;&lt;P&gt;hackcrr&lt;/P&gt;&lt;P&gt;If this post helps, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 12:57:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3908905#M152248</guid>
      <dc:creator>hackcrr</dc:creator>
      <dc:date>2024-05-10T12:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line by calculating custom summation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3909661#M152270</link>
      <description>&lt;P&gt;Thank you for your response. Something is off in the calculations.&lt;BR /&gt;&lt;BR /&gt;Posting the image of the real dataset with what is expected and what is happening in your solution.&lt;BR /&gt;The type column is just for example. There are multiple entries for the same unit and order_no with different types in the table. I want to sum all of them, no filtering on types. So just for information.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 17:44:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3909661#M152270</guid>
      <dc:creator>pbinewbie47</dc:creator>
      <dc:date>2024-05-10T17:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line by calculating custom summation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3909667#M152271</link>
      <description>&lt;P&gt;Thank you for your solution. I tried the solution and something is way off in the calculation.&lt;BR /&gt;The numbers are inflated and not matching the magnitude.&lt;BR /&gt;&lt;BR /&gt;The type column is just for additonal info, nothing changes in my calculation&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 17:48:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3909667#M152271</guid>
      <dc:creator>pbinewbie47</dc:creator>
      <dc:date>2024-05-10T17:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trend line by calculating custom summation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3916590#M152464</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="740414" data-lia-user-login="pbinewbie47" class="lia-mention lia-mention-user"&gt;pbinewbie47&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on my testing, please &lt;SPAN&gt;try the following methods:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the simple table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.Create the new measure to calculate the sales.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Final count = 
var _name=SELECTEDVALUE('Table'[Name])
var _order=SELECTEDVALUE('Table'[Order no])
var _preordera=CALCULATE(MAX('Table'[Order no]),FILTER(ALLSELECTED('Table'),'Table'[Name] = "A"&amp;amp;&amp;amp;'Table'[Order no] &amp;lt;= _order))
var _preorderb=CALCULATE(MAX('Table'[Order no]),FILTER(ALLSELECTED('Table'),'Table'[Name] = "B"&amp;amp;&amp;amp;'Table'[Order no] &amp;lt;= _order))
var _preorderc=CALCULATE(MAX('Table'[Order no]),FILTER(ALLSELECTED('Table'),'Table'[Name] = "C"&amp;amp;&amp;amp;'Table'[Order no] &amp;lt;= _order))
var _precounta=CALCULATE(MAX('Table'[Count]),FILTER(ALLSELECTED('Table'),'Table'[Name] = "A"&amp;amp;&amp;amp;'Table'[Order no] = _preordera))
var _precountb=CALCULATE(MAX('Table'[Count]),FILTER(ALLSELECTED('Table'),'Table'[Name] = "B"&amp;amp;&amp;amp;'Table'[Order no] = _preorderb))
var _precountc=CALCULATE(MAX('Table'[Count]),FILTER(ALLSELECTED('Table'),'Table'[Name] = "C"&amp;amp;&amp;amp;'Table'[Order no] = _preorderc))
return
 _precounta + _precountb + _precountc
 //_precounta&amp;amp;"+"&amp;amp;_precountb&amp;amp;"+"&amp;amp;_precountc&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;3.Drag the measure into the table visual. The result is shown below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 09:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trend-line-by-calculating-custom-summation/m-p/3916590#M152464</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-14T09:05:42Z</dc:date>
    </item>
  </channel>
</rss>

