<?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 Properly calculating cummulative value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4140888#M164555</link>
    <description>&lt;P&gt;I am struggling with cummulative value when I am creating a summarize table in dax measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using "others" to calculate the result for all other customers which have rank higher than parameter.&lt;/P&gt;&lt;P&gt;The revenue measure is following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Revenue = 

Var OrderOfAll = CALCULATE([Total Sales Dates Range Param.], REMOVEFILTERS(hlpCustomer[customer_name]))

RETURN
    IF(
        ISINSCOPE(hlpCustomer[customer_name]),
         Var ProductsToRank = hlpNumber[Number Value]
         Var IsotherSelected = SELECTEDVALUE(hlpCustomer[customer_name]) = "Others"
         Var ProductsWithOrderAmt = 
         ADDCOLUMNS(ALLSELECTED(hlpCustomer[customer_name]), "@Amt", [Total Sales Dates Range Param.])
         Var Top3Prods = TOPN(ProductsToRank, ProductsWithOrderAmt, [@Amt])
         Var OrdersOfTop3 = SUMX(Top3Prods, [@Amt])
         Var Result = IF(IsotherSelected, OrderOfAll - OrdersOfTop3, [Total Sales Dates Range Param.])
         Return Result, OrderOfAll
         
         
         
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to properly calculate increasing sum (cummalitive) - red colour on the screenshot?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1Y936d8gqn4JYdWi8PXyR9tHXqUo6pyJ0/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1Y936d8gqn4JYdWi8PXyR9tHXqUo6pyJ0/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2024 14:56:54 GMT</pubDate>
    <dc:creator>gumis_rulez</dc:creator>
    <dc:date>2024-09-09T14:56:54Z</dc:date>
    <item>
      <title>Properly calculating cummulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4140888#M164555</link>
      <description>&lt;P&gt;I am struggling with cummulative value when I am creating a summarize table in dax measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using "others" to calculate the result for all other customers which have rank higher than parameter.&lt;/P&gt;&lt;P&gt;The revenue measure is following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Revenue = 

Var OrderOfAll = CALCULATE([Total Sales Dates Range Param.], REMOVEFILTERS(hlpCustomer[customer_name]))

RETURN
    IF(
        ISINSCOPE(hlpCustomer[customer_name]),
         Var ProductsToRank = hlpNumber[Number Value]
         Var IsotherSelected = SELECTEDVALUE(hlpCustomer[customer_name]) = "Others"
         Var ProductsWithOrderAmt = 
         ADDCOLUMNS(ALLSELECTED(hlpCustomer[customer_name]), "@Amt", [Total Sales Dates Range Param.])
         Var Top3Prods = TOPN(ProductsToRank, ProductsWithOrderAmt, [@Amt])
         Var OrdersOfTop3 = SUMX(Top3Prods, [@Amt])
         Var Result = IF(IsotherSelected, OrderOfAll - OrdersOfTop3, [Total Sales Dates Range Param.])
         Return Result, OrderOfAll
         
         
         
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to properly calculate increasing sum (cummalitive) - red colour on the screenshot?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1Y936d8gqn4JYdWi8PXyR9tHXqUo6pyJ0/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1Y936d8gqn4JYdWi8PXyR9tHXqUo6pyJ0/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 14:56:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4140888#M164555</guid>
      <dc:creator>gumis_rulez</dc:creator>
      <dc:date>2024-09-09T14:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Properly calculating cummulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4140977#M164560</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="749867" data-lia-user-login="gumis_rulez" class="lia-mention lia-mention-user"&gt;gumis_rulez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can write it as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculate (sum(revenue), filter (table, evenue &amp;lt;= earlier (revenue))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post helps, then I would appreciate a thumbs up&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;and mark it as the solution&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2024 15:47:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4140977#M164560</guid>
      <dc:creator>Selva-Salimi</dc:creator>
      <dc:date>2024-09-09T15:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Properly calculating cummulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4141002#M164563</link>
      <description>&lt;P&gt;So you can use a quick measure to generate the cumulative total for you: See Quick Measure &amp;gt; Running total.&lt;/P&gt;&lt;P&gt;I think the DAX will look like this for your example:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sales running total in Customer_name =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; [Revenue],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; FILTER(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ALLSELECTED(),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ISONORAFTER('hlpCustomer'[customer_name], MAX('hlpCustomer'[customer_name]),ASC)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;)&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Sep 2024 15:59:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4141002#M164563</guid>
      <dc:creator>FlipFlop1</dc:creator>
      <dc:date>2024-09-09T15:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Properly calculating cummulative value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4142501#M164630</link>
      <description>&lt;P&gt;Thanks for the reply from&amp;nbsp;FlipFlop1&amp;nbsp;and&amp;nbsp;Selva-Salimi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="749867" data-lia-user-login="gumis_rulez" class="lia-mention lia-mention-user"&gt;gumis_rulez&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the formula I provided:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;MEASURE =&lt;BR /&gt;VAR _table =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;SUMMARIZE ( ALL ( 'hlpCustomer' ), 'hlpCustomer'[customer_name] ),&lt;BR /&gt;"rank", [Rank]&lt;BR /&gt;)&lt;BR /&gt;VAR _current_rank = [Rank]&lt;BR /&gt;RETURN&lt;BR /&gt;IF (&lt;BR /&gt;ISINSCOPE ( hlpCustomer[customer_name] ),&lt;BR /&gt;SUMX ( FILTER ( _table, [rank] &amp;lt;= _current_rank ), [Revenue] )&lt;BR /&gt;)&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any 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;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 10 Sep 2024 09:59:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Properly-calculating-cummulative-value/m-p/4142501#M164630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-10T09:59:43Z</dc:date>
    </item>
  </channel>
</rss>

