<?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: PowerBI Percentage Difference between two selected dates in a filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4128954#M163972</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799232" data-lia-user-login="EuroK4238" class="lia-mention lia-mention-user"&gt;EuroK4238&lt;/a&gt;&amp;nbsp;&lt;A href="https://www.aarp-mahjongg.com/" target="_self"&gt;aarp mahjongg&lt;/A&gt;wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm new to PowerBI and so far ChatGPT has been my best friend, but it seems it has exhausted its usefulness because we're going around in circles with the same proposed solutions.&lt;BR /&gt;&lt;BR /&gt;what i am trying to make is a report with balance sheet and income statement data for several industry actors, for several quarters, and it's fine so far, but what i want to add now is a dynamic percentage change for these values, which picks only the most recent and the oldest selected dates in a filter.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So far, using this code i get a difference of zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code used to select the dates is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RecentDate = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Balance Unpivot'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AncientDate= &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;('Balance Unpivot'[DATE])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This works, it shows the correct dates in a card visual element.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then, the code used to pick the values for only these dates is as follows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ValueAncientDate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Balance Unpivot'&lt;/SPAN&gt;&lt;SPAN&gt;[Values]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Balance Unpivot'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Balance Unpivot'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[AncientDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ValueRecentDate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('Balance Unpivot'[Values]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Balance Unpivot',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Balance Unpivot'[DATE] = [RecentDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this is where we run into issues, because when i put these two measures into a matrix, both give me the same result, so calculating the difference between them always gives zero.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My data (unpivoted) is structured as follows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Columns: Company, Date, ROW_ID, Attribute (total assets, liabilities, etc) and Values.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The issue with your current calculation lies in the use of SELECTEDVALUE. To correctly calculate the percentage change, use SUM to aggregate the values for the ancient and recent dates. Then, use DIVIDE to calculate the percentage change. Ensure that the Values column is numeric and that other filters don't interfere with the date-based calculations.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2024 04:20:10 GMT</pubDate>
    <dc:creator>monica345</dc:creator>
    <dc:date>2024-09-03T04:20:10Z</dc:date>
    <item>
      <title>PowerBI Percentage Difference between two selected dates in a filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4125720#M163840</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm new to PowerBI and so far ChatGPT has been my best friend, but it seems it has exhausted its usefulness because we're going around in circles with the same proposed solutions.&lt;BR /&gt;&lt;BR /&gt;what i am trying to make is a report with balance sheet and income statement data for several industry actors, for several quarters, and it's fine so far, but what i want to add now is a dynamic percentage change for these values, which picks only the most recent and the oldest selected dates in a filter.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So far, using this code i get a difference of zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code used to select the dates is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RecentDate = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Balance Unpivot'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AncientDate= &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;('Balance Unpivot'[DATE])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This works, it shows the correct dates in a card visual element.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then, the code used to pick the values for only these dates is as follows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ValueAncientDate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SP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PAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Balance Unpivot',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Balance Unpivot'[DATE] = [RecentDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this is where we run into issues, because when i put these two measures into a matrix, both give me the same result, so calculating the difference between them always gives zero.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My data (unpivoted) is structured as follows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Columns: Company, Date, ROW_ID, Attribute (total assets, liabilities, etc) and Values.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Aug 2024 22:00:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4125720#M163840</guid>
      <dc:creator>EuroK4238</dc:creator>
      <dc:date>2024-08-29T22:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Percentage Difference between two selected dates in a filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4125782#M163841</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799232" data-lia-user-login="EuroK4238" class="lia-mention lia-mention-user"&gt;EuroK4238&lt;/a&gt;, try these measures below, and if you encounter any issues, let me know.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ValueAncientDate =
CALCULATE(
    SUM('Balance Unpivot'[Values]), 
    FILTER(
        'Balance Unpivot',
        'Balance Unpivot'[DATE] = [AncientDate]
        &amp;amp;&amp;amp; 'Balance Unpivot'[Attribute] = SELECTEDVALUE('Balance Unpivot'[Attribute])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ValueRecentDate =
CALCULATE(
    SUM('Balance Unpivot'[Values]), 
    FILTER(
        'Balance Unpivot',
        'Balance Unpivot'[DATE] = [RecentDate]
        &amp;amp;&amp;amp; 'Balance Unpivot'[Attribute] = SELECTEDVALUE('Balance Unpivot'[Attribute])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Calculate the percentage change:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PercentageChange =
DIVIDE(
    [ValueRecentDate] - [ValueAncientDate], 
    [ValueAncientDate],
    0
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="center"&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Did I answer your question?&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;If so, please mark my post as the solution! &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Your Kudos are much appreciated!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Proud to be a Solution Supplier!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 23:14:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4125782#M163841</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-29T23:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Percentage Difference between two selected dates in a filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4127126#M163888</link>
      <description>&lt;P&gt;Hi, thank you for your quick response.&lt;/P&gt;&lt;P&gt;I tried your proposed solution, but PerecentageChange comes up as zero for all attributes, same as the solutions proposed by ChatGPT.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 14:39:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4127126#M163888</guid>
      <dc:creator>EuroK4238</dc:creator>
      <dc:date>2024-08-30T14:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Percentage Difference between two selected dates in a filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4128954#M163972</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799232" data-lia-user-login="EuroK4238" class="lia-mention lia-mention-user"&gt;EuroK4238&lt;/a&gt;&amp;nbsp;&lt;A href="https://www.aarp-mahjongg.com/" target="_self"&gt;aarp mahjongg&lt;/A&gt;wrote:&lt;BR /&gt;&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I'm new to PowerBI and so far ChatGPT has been my best friend, but it seems it has exhausted its usefulness because we're going around in circles with the same proposed solutions.&lt;BR /&gt;&lt;BR /&gt;what i am trying to make is a report with balance sheet and income statement data for several industry actors, for several quarters, and it's fine so far, but what i want to add now is a dynamic percentage change for these values, which picks only the most recent and the oldest selected dates in a filter.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So far, using this code i get a difference of zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code used to select the dates is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RecentDate = &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Balance Unpivot'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AncientDate= &lt;/SPAN&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt;('Balance Unpivot'[DATE])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This works, it shows the correct dates in a card visual element.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then, the code used to pick the values for only these dates is as follows:&lt;/SPAN&gt;&lt;/D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lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ValueRecentDate = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('Balance Unpivot'[Values]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Balance Unpivot',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Balance Unpivot'[DATE] = [RecentDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this is where we run into issues, because when i put these two measures into a matrix, both give me the same result, so calculating the difference between them always gives zero.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My data (unpivoted) is structured as follows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Columns: Company, Date, ROW_ID, Attribute (total assets, liabilities, etc) and Values.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Please help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The issue with your current calculation lies in the use of SELECTEDVALUE. To correctly calculate the percentage change, use SUM to aggregate the values for the ancient and recent dates. Then, use DIVIDE to calculate the percentage change. Ensure that the Values column is numeric and that other filters don't interfere with the date-based calculations.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 04:20:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4128954#M163972</guid>
      <dc:creator>monica345</dc:creator>
      <dc:date>2024-09-03T04:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Percentage Difference between two selected dates in a filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4129239#M163985</link>
      <description>&lt;P&gt;Thanks for the reply from&amp;nbsp;ahadkarimi&amp;nbsp;and&amp;nbsp;monica345.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799232" data-lia-user-login="EuroK4238" class="lia-mention lia-mention-user"&gt;EuroK4238&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to do a percentage calculation on the values of the filtered &lt;SPAN&gt;recent date&lt;/SPAN&gt;&amp;nbsp;and a&lt;SPAN&gt;ncient date&amp;nbsp;&lt;/SPAN&gt;in the matrix? If I understand you correctly, please see the steps below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.Create simple data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.Create a new table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Date = VALUES('Balance Unpivot'[Date])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3.Use the Date column as the field of slicer:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4.The two original measures:&amp;nbsp;&lt;SPAN&gt;RecentDate and&amp;nbsp;AncientDate&lt;/SPAN&gt;&amp;nbsp;need to be modified.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AncientDate = MINX(VALUES('Date'[Date]),'Date'[Date])

RecentDate = MAXX(VALUES('Date'[Date]),'Date'[Date])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5.The final result is as follows:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 09:09:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4129239#M163985</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-02T09:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: PowerBI Percentage Difference between two selected dates in a filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4129543#M164005</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;and thank you for your response.&lt;BR /&gt;&lt;BR /&gt;Would this work with data that isn't aggregated, and for multiple companies? here is my proposed report:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;my rows contain specific balance sheet data, so i can't aggregate them. what i need to show is the percentage change for every element of the balance sheet, between two filtered dates, for several companies. The first matrix in the picture shows the balance sheet data for multiple companies and periods, and i intend to show the percentage change for every balance sheet element between the oldest and most recent date, that way only one column has to be added to the matrix, not one for every variation for every selected period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the second matrix, on the right, is where i was testing the AncientDate and Recentdate values, but i hope the variation can be added as a single column beside the filtered dates for every selected company.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final result you show in the 5th step would be perfect if it were filtered by balance sheet element.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a sample of the Balance Unpivot table, for reference.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Empresa is the Companies, Fecha is Date, Atributo is the balance sheet elements, and Valor is the Value for that balance sheet element, for a specific date, for a specific company.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 13:01:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerBI-Percentage-Difference-between-two-selected-dates-in-a/m-p/4129543#M164005</guid>
      <dc:creator>EuroK4238</dc:creator>
      <dc:date>2024-09-02T13:01:03Z</dc:date>
    </item>
  </channel>
</rss>

