<?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: Trying to calculate percentage change with previous row in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1449980#M27223</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="218399" data-lia-user-login="rischav" class="lia-mention lia-mention-user"&gt;rischav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly what you are doing, we need to account for the additional fields you are including in the visual and that will be part of the filter context:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
DIVIDE (
    [Expenditures total amount],
    CALCULATE (
        [Expenditures total amount],
        FILTER (
            ALL ( Table1[Index] ),
            Table1[Index]
                = ( SELECTEDVALUE ( Table1[Index] ) - 1 )
        ),
       ALLEXCEPT(Table1, Table1[Program])
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This actually assumes the previous item of interest has always the current index -1 as index, and that you want to look at the change within the current Program. Otherwise more changes will be necessary&lt;/P&gt;
&lt;P&gt;If you share the pbix (privately if necessary) or a mock version that reproduces the issue, it will be easier to work out the solution&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 15:23:06 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-10-22T15:23:06Z</dc:date>
    <item>
      <title>Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1443674#M27031</link>
      <description>&lt;P&gt;Hey everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to calculate the percentage change compared to the previous row for the expenditures column. This would a column next to the last column. so row 2 would have the percentage change between row 1 and 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background on the index column: The index column is created for a months column but I could not convert the months column into a date column since there are some years when there is a 13th and 14th month for some settlements and power Bi would not recognize that since a year can't have more than 12 months.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Background on the expenditures column: Please note, the expenditures column is a measure that is a sum of expenses for multiple conditions on account numbers. I hope this makes sense. Looking forward to hearing from someone.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 03:50:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1443674#M27031</guid>
      <dc:creator>rischav</dc:creator>
      <dc:date>2020-10-20T03:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1443774#M27036</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="218399" data-lia-user-login="rischav" class="lia-mention lia-mention-user"&gt;rischav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using the [Expenditures total amount] column in a table visual with ID and Index in rows, as you seem to be showing, then use this measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
DIVIDE (
    [Expenditures total amount],
    CALCULATE (
        [Expenditures total amount],
        FILTER (
            ALL ( Table1[Index] ),
            Table1[Index]
                = ( SELECTEDVALUE ( Table1[Index] ) - 1 )
        )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;and format it as % if necessary&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 05:36:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1443774#M27036</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-10-20T05:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1444901#M27062</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;You're a savior! Thanks a lot for the help&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 12:54:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1444901#M27062</guid>
      <dc:creator>rischav</dc:creator>
      <dc:date>2020-10-20T12:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1444910#M27063</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;One quick follow up question. There is also a month column that has all the months January, february and so on..... based on the index. when I add the month column to the table visual, the calculation disppears. Is there a fix for that?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, I added the month as a slicer and when I select a month, the % change disppears.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:02:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1444910#M27063</guid>
      <dc:creator>rischav</dc:creator>
      <dc:date>2020-10-20T13:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1445006#M27069</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="218399" data-lia-user-login="rischav" class="lia-mention lia-mention-user"&gt;rischav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would need some more info. If the % disappears, it is most likely because the&amp;nbsp; SELECTEDVALUE ( Table1[Index] ) is returning a blank, which means we have more than one value for Table1[Index] in the filter context. Could that be the case? Also, if you are adding fields to the visual we probably have to take them into account in the measure, since we want to have the value of the previous line and that might have a different value for those fields (just as it happens with Index in the current version of the measure). Can you show at least what the visual would look like in this case, so that i can have an idea of what I was describing above? &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving kudos if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 13:50:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1445006#M27069</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-10-20T13:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1448008#M27173</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for getting back and I apologize for the late reply. The table visual looks likes this where I've added the % change based on the DAX formula you provided. The screenshot provided below shows the table and when I bring in the month column alongwith the index column, the %change disappears. the index has 13 counts since we have a 13th month called the adjustment month and hence i cannot use this as a date/month column.&amp;nbsp;&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 23:52:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1448008#M27173</guid>
      <dc:creator>rischav</dc:creator>
      <dc:date>2020-10-21T23:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1449980#M27223</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="218399" data-lia-user-login="rischav" class="lia-mention lia-mention-user"&gt;rischav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly what you are doing, we need to account for the additional fields you are including in the visual and that will be part of the filter context:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
DIVIDE (
    [Expenditures total amount],
    CALCULATE (
        [Expenditures total amount],
        FILTER (
            ALL ( Table1[Index] ),
            Table1[Index]
                = ( SELECTEDVALUE ( Table1[Index] ) - 1 )
        ),
       ALLEXCEPT(Table1, Table1[Program])
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This actually assumes the previous item of interest has always the current index -1 as index, and that you want to look at the change within the current Program. Otherwise more changes will be necessary&lt;/P&gt;
&lt;P&gt;If you share the pbix (privately if necessary) or a mock version that reproduces the issue, it will be easier to work out the solution&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 15:23:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/1449980#M27223</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-10-22T15:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to calculate percentage change with previous row</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/2374402#M61075</link>
      <description>&lt;P&gt;Hi, Im very new to all this. I've created my own table to mimic the example above, yet the measure is syntactially incorrect. "Cannot Find Name Expenditures Total Amount".&amp;nbsp; Do you have to wrap those columns into some function to make this work?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 07:47:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Trying-to-calculate-percentage-change-with-previous-row/m-p/2374402#M61075</guid>
      <dc:creator>MichaelDaSIlva</dc:creator>
      <dc:date>2022-03-04T07:47:55Z</dc:date>
    </item>
  </channel>
</rss>

