<?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 How to create a column that completes itself based on values from the column itself? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4313799#M171296</link>
    <description>&lt;P&gt;For example I have a table that has actuals from January to April, and then for the rest of the year, I have to calculate based on the previous value.&lt;/P&gt;&lt;P&gt;Let's say April has 1000, so for May my calculation should be April's value + 500.&amp;nbsp; Then for June, I need to take May's value and add 500 and so on.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible to do in DAX?&amp;nbsp; Is using the same values calculated in a column to complete the rest, self referencing.&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Dec 2024 16:20:07 GMT</pubDate>
    <dc:creator>Tonocop2390</dc:creator>
    <dc:date>2024-12-04T16:20:07Z</dc:date>
    <item>
      <title>How to create a column that completes itself based on values from the column itself?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4313799#M171296</link>
      <description>&lt;P&gt;For example I have a table that has actuals from January to April, and then for the rest of the year, I have to calculate based on the previous value.&lt;/P&gt;&lt;P&gt;Let's say April has 1000, so for May my calculation should be April's value + 500.&amp;nbsp; Then for June, I need to take May's value and add 500 and so on.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible to do in DAX?&amp;nbsp; Is using the same values calculated in a column to complete the rest, self referencing.&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 16:20:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4313799#M171296</guid>
      <dc:creator>Tonocop2390</dc:creator>
      <dc:date>2024-12-04T16:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a column that completes itself based on values from the column itself?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4314036#M171308</link>
      <description>&lt;P&gt;You cannot do self referencing in DAX.&amp;nbsp; You can do aggregations like SUMX in some scenarios.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 20:54:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4314036#M171308</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-04T20:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a column that completes itself based on values from the column itself?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4325482#M171722</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="887251" data-lia-user-login="Tonocop2390" class="lia-mention lia-mention-user"&gt;Tonocop2390&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please try the code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column2 = 
Var _Month=
CALCULATE(
    MAX('Table'[Month]),
    FILTER('Table',[Value]&amp;lt;&amp;gt;BLANK())
    )
Var _Sum=
CALCULATE(
    SUM('Table'[Column]),
    FILTER('Table',[Month]&amp;lt;=EARLIER('Table'[Month])&amp;amp;&amp;amp;[Month]&amp;gt;=_Month)
    )
RETURN
IF([Value]&amp;lt;&amp;gt;BLANK(),[Value],_Sum)&lt;/LI-CODE&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;Lucy Chen&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it&lt;/EM&gt;&lt;/STRONG&gt; as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 08:53:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4325482#M171722</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T08:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a column that completes itself based on values from the column itself?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4327207#M171784</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="887251" data-lia-user-login="Tonocop2390" class="lia-mention lia-mention-user"&gt;Tonocop2390&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you can achieve this in DAX by creating a calculated column using a pattern that references previous rows. However, DAX doesn't allow true self-referencing in calculated columns directly. Instead, we use functions like EARLIER or VAR along with row context to simulate this behavior.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Create a Calculated Column&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DAX:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calculated Column =
VAR CurrentMonth = Table[Month]
VAR PreviousMonthValue =
    CALCULATE(
        MAX(Table[Calculated Column]),
        FILTER(
            Table,
            Table[Month] = FORMAT(DATEADD(DATEVALUE("1 " &amp;amp; CurrentMonth), -1, MONTH), "mmmm")
        )
    )
RETURN
IF(
    ISBLANK(Table[Actuals]),
    PreviousMonthValue + 500,
    Table[Actuals]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your table isn't sorted by months, ensure to use a date field or sort it correctly for accurate calculations.&lt;/P&gt;&lt;P&gt;DAX calculated columns are evaluated row by row, so they cannot dynamically reference themselves. The FILTER and CALCULATE pattern simulates this behavior.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;BR /&gt;&lt;STRONG&gt;Consider Subscribing my YouTube for Beginners/Advance Concepts:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS" target="_self"&gt;https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 05:18:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-column-that-completes-itself-based-on-values/m-p/4327207#M171784</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2024-12-13T05:18:03Z</dc:date>
    </item>
  </channel>
</rss>

