<?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: Calculation by Row by Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998543#M101135</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419809" data-lia-user-login="Fantmas" class="lia-mention lia-mention-user"&gt;Fantmas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Supply =
VAR t =
    SELECTEDVALUE ( Table2[Year] )
RETURN
    SUMX (
        Table1,
        VAR a = Table1[ValueA]
        VAR b = Table1[ValueB]
        RETURN
            a * ( 1 - b ) ^ t
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 03 Jan 2023 12:37:09 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-01-03T12:37:09Z</dc:date>
    <item>
      <title>Calculation by Row by Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998326#M101118</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a measure to Dynamically calculate by row a value through year :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my first table I have the value a &amp;amp; b&lt;BR /&gt;a is a decimal number&lt;BR /&gt;b is a integer&lt;BR /&gt;&lt;BR /&gt;In a another table I have my value:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;t is the year starting from 1 and go up to 6&lt;BR /&gt;&lt;BR /&gt;the year can dynamically change and I am stuck in my DAx formula as I am using CALCULATE and SUM&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Supply = 


CALCULATE( CALCULATE(SUM(a) * POWER((1 - SUM(b),t))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;In excel the formula is as Follow :&lt;BR /&gt;&lt;BR /&gt;a * (1 - b ) ^ t&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 10:33:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998326#M101118</guid>
      <dc:creator>Fantmas</dc:creator>
      <dc:date>2023-01-03T10:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation by Row by Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998411#M101127</link>
      <description>&lt;P&gt;To replicate this formula in DAX, you can try the following:&lt;/P&gt;&lt;P&gt;Supply =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(a) * POWER(1 - SUM(b), t),&lt;BR /&gt;ALLSELECTED(table)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;This will calculate the value of Supply using the values of a and b in the current context, and raise the result of 1 - SUM(b) to the power of t. The ALLSELECTED function is used to remove any filters on table, so that the full range of a and b values is used in the calculation.&lt;/P&gt;&lt;P&gt;If you want to use a specific year value for t instead of a dynamic value, you can replace the t column reference with a fixed value or another measure. For example:&lt;/P&gt;&lt;P&gt;Supply =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(a) * POWER(1 - SUM(b), 3),&lt;BR /&gt;ALLSELECTED(table)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;This would calculate the value of Supply using the values of a and b in the current context, and raise the result of 1 - SUM(b) to the power of 3.&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any further questions.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 11:25:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998411#M101127</guid>
      <dc:creator>MatthRichardsUK</dc:creator>
      <dc:date>2023-01-03T11:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation by Row by Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998543#M101135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="419809" data-lia-user-login="Fantmas" class="lia-mention lia-mention-user"&gt;Fantmas&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please try&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Supply =
VAR t =
    SELECTEDVALUE ( Table2[Year] )
RETURN
    SUMX (
        Table1,
        VAR a = Table1[ValueA]
        VAR b = Table1[ValueB]
        RETURN
            a * ( 1 - b ) ^ t
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 03 Jan 2023 12:37:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998543#M101135</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-01-03T12:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation by Row by Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998568#M101137</link>
      <description>&lt;P&gt;Hi Matth,&lt;BR /&gt;&lt;BR /&gt;Thank you for your answer, I tried your solution but it is not working, I should find a figures around 600 for my test but I find a figures around 2M,&lt;BR /&gt;&lt;BR /&gt;My assumption it is POWER function is done after the sum function that create the issue&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 12:48:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-by-Row-by-Year/m-p/2998568#M101137</guid>
      <dc:creator>Fantmas</dc:creator>
      <dc:date>2023-01-03T12:48:45Z</dc:date>
    </item>
  </channel>
</rss>

