<?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: I need help creating calculated column that sums a value from row above it in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3450135#M131401</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555444" data-lia-user-login="wrigh2uk" class="lia-mention lia-mention-user"&gt;wrigh2uk&lt;/a&gt;&amp;nbsp;, you have 2 options. Calculated column:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;actual modelled cln =
VAR tableWithValue =
    FILTER ( VALUES ( 'Table'[actual] ), 'Table'[actual] &amp;lt;&amp;gt; BLANK () )
VAR maxYearWithValue =
    CALCULATE ( MAX ( 'Table'[year] ), tableWithValue, ALL ( 'Table' ) )
VAR maxValue =
    CALCULATE (
        MAX ( 'Table'[actual] ),
        'Table'[year] = maxYearWithValue,
        ALL ( 'Table' )
    )
VAR res = maxValue + ( 'Table'[year] - maxYearWithValue ) * 10
RETURN
    IF ( 'Table'[actual] = BLANK (), res )&lt;/LI-CODE&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;actual modelled msr = 
VAR maxYearWithValue =
    CALCULATE (
        MAX ( 'Table'[year] ),
        ALL ( 'Table' ),
        'Table'[actual] &amp;lt;&amp;gt; BLANK ()
    )
VAR maxValue =
    CALCULATE (
        MAX ( 'Table'[actual] ),
        'Table'[year] = maxYearWithValue,
        ALL ( 'Table' )
    )
VAR res = maxValue + ( SELECTEDVALUE ( 'Table'[year] ) - maxYearWithValue ) * 10
RETURN
    IF (
        ISINSCOPE ( 'Table'[year] ) &amp;amp;&amp;amp; SELECTEDVALUE ( 'Table'[actual] ) = BLANK (),
        res
    )&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 27 Sep 2023 15:32:14 GMT</pubDate>
    <dc:creator>ERD</dc:creator>
    <dc:date>2023-09-27T15:32:14Z</dc:date>
    <item>
      <title>I need help creating calculated column that sums a value from row above it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3449557#M131359</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;year&lt;/TD&gt;&lt;TD&gt;actual&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;actual modelled&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2025&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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;&lt;P&gt;I'm hoping you can help me. I have this table with 3 columns.&lt;BR /&gt;&lt;BR /&gt;actual modelled will be my calculated column. What I need this column to do is from 2023 add 10 on to each value. The result is that it would look something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;year&lt;/TD&gt;&lt;TD&gt;actual&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;actual modelled&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 210&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2024&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 220&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2025&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 230&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2026&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; &amp;nbsp; 240&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;really appreciate your help&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 10:38:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3449557#M131359</guid>
      <dc:creator>wrigh2uk</dc:creator>
      <dc:date>2023-09-27T10:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: I need help creating calculated column that sums a value from row above it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3449582#M131362</link>
      <description>&lt;P&gt;You can use the following measure&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;actual modelled = &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR BaseValue = 200 // The initial value for the year 2022 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR YearDifference = YEAR('YourTable'[Year]) - 2022 // Calculate the difference from 2022 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RETURN &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF( YearDifference &amp;gt; 0, // Check if it's 2023 or later &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BaseValue + (YearDifference * 10), // Add 10 for each year beyond 2022 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BLANK() // Leave earlier years blank &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 10:52:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3449582#M131362</guid>
      <dc:creator>nirali_arora</dc:creator>
      <dc:date>2023-09-27T10:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: I need help creating calculated column that sums a value from row above it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3449754#M131368</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;as a measure this doesn't work as the &lt;SPAN&gt;VAR YearDifference needs to be a aggregate function (when I try and find the field name it says cannot find otherwise). This would also go for&amp;nbsp;VAR BaseValue&amp;nbsp;as i can't really have this as&amp;nbsp; static value.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 12:40:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3449754#M131368</guid>
      <dc:creator>wrigh2uk</dc:creator>
      <dc:date>2023-09-27T12:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: I need help creating calculated column that sums a value from row above it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3450135#M131401</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="555444" data-lia-user-login="wrigh2uk" class="lia-mention lia-mention-user"&gt;wrigh2uk&lt;/a&gt;&amp;nbsp;, you have 2 options. Calculated column:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;actual modelled cln =
VAR tableWithValue =
    FILTER ( VALUES ( 'Table'[actual] ), 'Table'[actual] &amp;lt;&amp;gt; BLANK () )
VAR maxYearWithValue =
    CALCULATE ( MAX ( 'Table'[year] ), tableWithValue, ALL ( 'Table' ) )
VAR maxValue =
    CALCULATE (
        MAX ( 'Table'[actual] ),
        'Table'[year] = maxYearWithValue,
        ALL ( 'Table' )
    )
VAR res = maxValue + ( 'Table'[year] - maxYearWithValue ) * 10
RETURN
    IF ( 'Table'[actual] = BLANK (), res )&lt;/LI-CODE&gt;&lt;P&gt;Measure:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;actual modelled msr = 
VAR maxYearWithValue =
    CALCULATE (
        MAX ( 'Table'[year] ),
        ALL ( 'Table' ),
        'Table'[actual] &amp;lt;&amp;gt; BLANK ()
    )
VAR maxValue =
    CALCULATE (
        MAX ( 'Table'[actual] ),
        'Table'[year] = maxYearWithValue,
        ALL ( 'Table' )
    )
VAR res = maxValue + ( SELECTEDVALUE ( 'Table'[year] ) - maxYearWithValue ) * 10
RETURN
    IF (
        ISINSCOPE ( 'Table'[year] ) &amp;amp;&amp;amp; SELECTEDVALUE ( 'Table'[actual] ) = BLANK (),
        res
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Sep 2023 15:32:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3450135#M131401</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2023-09-27T15:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: I need help creating calculated column that sums a value from row above it</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3544530#M136285</link>
      <description>&lt;P&gt;This was perfect for what I needed. Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 11:21:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-need-help-creating-calculated-column-that-sums-a-value-from/m-p/3544530#M136285</guid>
      <dc:creator>wrigh2uk</dc:creator>
      <dc:date>2023-11-21T11:21:23Z</dc:date>
    </item>
  </channel>
</rss>

