<?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: Running total not for a sum but a product (multiplication not addition) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3851142#M150486</link>
    <description>&lt;P&gt;Hi again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="720798" data-lia-user-login="McShock" class="lia-mention lia-mention-user"&gt;McShock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sure! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Assuming you already have a measure which produces return values by year say, you would then use PRODUCTX to multiply by year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume &lt;STRONG&gt;Yearly Return Base Measure&amp;nbsp;&lt;/STRONG&gt;is the "base measure" for return by year (replace with your existing measure):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Yearly Return Base Measure = 
// Replace with appropriate definition
PRODUCTX ( 'Return', 1 + 'Return'[Yearly Return] ) - 1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you would write &lt;STRONG&gt;Return Index&lt;/STRONG&gt; as follows:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return Index = 
PRODUCTX ( VALUES ( 'Date'[Year] ), 1 + [Yearly Return Base Measure] )&lt;/LI-CODE&gt;
&lt;P&gt;The other measures would remain the same as before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated PBIX attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2024 22:28:22 GMT</pubDate>
    <dc:creator>OwenAuger</dc:creator>
    <dc:date>2024-04-18T22:28:22Z</dc:date>
    <item>
      <title>Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3848002#M150376</link>
      <description>&lt;P&gt;Hi, I wonder if there is any way to calculate with DAX kind of a running total but instead of adding the values by multiplying the values. I give a concrete example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 4 yearly returns betwen 2020 and 2023 (+10%, -10%, -5%, +30%) and I want to know what my overall return is since the beginning (31/12/2020). Because of the compounding nature of returns I can not add the returns but need to multiplying them. Adding them would give +25% after 4 years but compounding them yields +22.3%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Excel I would do this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how can this be done in PBI?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your brain power.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 06:47:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3848002#M150376</guid>
      <dc:creator>McShock</dc:creator>
      <dc:date>2024-04-18T06:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3849549#M150418</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="720798" data-lia-user-login="McShock" class="lia-mention lia-mention-user"&gt;McShock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PRODUCT or PRODUCTX functions are what I would suggest here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an initial suggestion, see the attached PBIX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Return&lt;/STRONG&gt; table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Related to &lt;STRONG&gt;Date&lt;/STRONG&gt; table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;And these are some initial measures you could create.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Return Index&lt;/STRONG&gt; is the base measure that returns the product of (1+return) for each period.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return Index = 
PRODUCTX ( 'Return', 1 + 'Return'[Yearly Return] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Return = 
VAR ReturnIndex = [Return Index]
RETURN
    IF (
        NOT ISBLANK ( ReturnIndex ),
        ReturnIndex - 1
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Return Index = 
CALCULATE (
    [Return Index],
    'Date'[Date] &amp;lt;= MAX ( 'Date'[Date] )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Return = 
CALCULATE (
    [Return],
    'Date'[Date] &amp;lt;= MAX ( 'Date'[Date] )
)&lt;/LI-CODE&gt;
&lt;P&gt;Sample visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The above is intended to illustrate the basic logic. Depending on your overall model, some adjustments to the measures might be needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully this is some help!&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:33:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3849549#M150418</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2024-04-18T11:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3849713#M150423</link>
      <description>&lt;P&gt;Hi Owen, this is extremely helpful. Thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 12:10:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3849713#M150423</guid>
      <dc:creator>McShock</dc:creator>
      <dc:date>2024-04-18T12:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3850670#M150461</link>
      <description>&lt;P&gt;Hi, I can not replicate this. Not even the first measure&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I think the problem is, that my returns are the result of a caluculation within a measure whereas yours are in a column of a table. Can you guide me how to handle this?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 16:46:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3850670#M150461</guid>
      <dc:creator>McShock</dc:creator>
      <dc:date>2024-04-18T16:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3851142#M150486</link>
      <description>&lt;P&gt;Hi again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="720798" data-lia-user-login="McShock" class="lia-mention lia-mention-user"&gt;McShock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sure! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Assuming you already have a measure which produces return values by year say, you would then use PRODUCTX to multiply by year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume &lt;STRONG&gt;Yearly Return Base Measure&amp;nbsp;&lt;/STRONG&gt;is the "base measure" for return by year (replace with your existing measure):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Yearly Return Base Measure = 
// Replace with appropriate definition
PRODUCTX ( 'Return', 1 + 'Return'[Yearly Return] ) - 1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you would write &lt;STRONG&gt;Return Index&lt;/STRONG&gt; as follows:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return Index = 
PRODUCTX ( VALUES ( 'Date'[Year] ), 1 + [Yearly Return Base Measure] )&lt;/LI-CODE&gt;
&lt;P&gt;The other measures would remain the same as before.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Updated PBIX attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 22:28:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3851142#M150486</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2024-04-18T22:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3855515#M150633</link>
      <description>&lt;P&gt;Hi, sorry to disturb you again. I am getting closer but some dax is not working properly and I do not know what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have so far is:&lt;/P&gt;&lt;P&gt;Monthly returns:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Return Index (interestingly it does not show the total)&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;Return&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But the Monthly Return Base Measure yields 0 for all months:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why this happens?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Apr 2024 08:49:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3855515#M150633</guid>
      <dc:creator>McShock</dc:creator>
      <dc:date>2024-04-20T08:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Running total not for a sum but a product (multiplication not addition)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3856771#M150663</link>
      <description>&lt;P&gt;Hi again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="720798" data-lia-user-login="McShock" class="lia-mention lia-mention-user"&gt;McShock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The measure &lt;STRONG&gt;Yearly&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;Return Base Measure&lt;/STRONG&gt; in my earlier reply was actually intended to be the equivalent of your&amp;nbsp;&lt;STRONG&gt;Performance %&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Based on your screenshots, and assuming &lt;STRONG&gt;Performance %&lt;/STRONG&gt; is evaluated monthly, I would define the measures in this sequence (I slightly adjusted compared to earlier version):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Performance %&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;As per your definition (I have used a dummy definition).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Return Index&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return Index = 
PRODUCTX (
    VALUES ( 'Date'[Month Start Date] ),
    VAR PerformancePct = [Performance %]
    RETURN
        IF (
            NOT ISBLANK ( PerformancePct ),
            1 + PerformancePct
        )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Return&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Return = 
VAR ReturnIndex = [Return Index]
RETURN
    IF (
        NOT ISBLANK ( ReturnIndex ),
        ReturnIndex - 1
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Cumulative Return Index&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Ensures values don't go beyond last month with data&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Return Index = 
VAR MaxMonthGlobal =
    EOMONTH ( CALCULATE ( MAX ( 'Return'[Date] ), REMOVEFILTERS () ), 0 )
-- Min/Max dates in current context
VAR MinDate = MIN ( 'Date'[Date] )
VAR MaxDate = MAX ( 'Date'[Date] )
RETURN
    IF (
        MinDate &amp;lt;= MaxMonthGlobal,
        CALCULATE (
            [Return Index],
            'Date'[Date] &amp;lt;= MaxDate
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Cumulative Return&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cumulative Return = 
VAR CumulativeReturnIndex = [Cumulative Return Index]
RETURN
    IF (
        NOT ISBLANK ( CumulativeReturnIndex ),
        CumulativeReturnIndex - 1
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PBIX attached &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 12:12:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-total-not-for-a-sum-but-a-product-multiplication-not/m-p/3856771#M150663</guid>
      <dc:creator>OwenAuger</dc:creator>
      <dc:date>2024-04-21T12:12:05Z</dc:date>
    </item>
  </channel>
</rss>

