<?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: Calculate Percentage Change from First to Last Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255851#M54440</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; Thanks a mill.&amp;nbsp; This solution worked like a charm.&amp;nbsp; I just hard-coded the year's as my dataset min year starts at 1960 and max year ends at 2020.&lt;BR /&gt;&lt;BR /&gt;Here is the sample of my Dax:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% Change GDP per capita, PPP (current international $) = 
var _min = YEAR( " December 2010" )
var _max = YEAR( "December 2018" )
var _calc =calculate( [Private health expenditure (% of current health expenditure)], filter(ALL( Data_WB_HNP_WDI), Data_WB_HNP_WDI[Year]=_max)) -
calculate( [Private health expenditure (% of current health expenditure)], filter(ALL( Data_WB_HNP_WDI), Data_WB_HNP_WDI[Year]=_min))

return
DIVIDE( _calc, calculate( [Private health expenditure (% of current health expenditure)], filter(ALL( Data_WB_HNP_WDI), Data_WB_HNP_WDI[Year]=_min)), 0 )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Solution:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 Dec 2021 08:03:05 GMT</pubDate>
    <dc:creator>BICrazy</dc:creator>
    <dc:date>2021-12-26T08:03:05Z</dc:date>
    <item>
      <title>Calculate Percentage Change from First to Last Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255377#M54428</link>
      <description>&lt;P&gt;Hi the Power BI Community,&lt;BR /&gt;&lt;BR /&gt;I've been able to calculate the YoY percentage change, however, I need to calculate the percentage change from the earliest year (2010) to the latest year(2018) of a data set and display this as a card.&lt;BR /&gt;&lt;BR /&gt;Here are my current calculations which are correct.&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;The 7.06%&amp;nbsp; calculated below is what I'd like to show as a card visual.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Start&lt;/TD&gt;&lt;TD&gt;End&lt;/TD&gt;&lt;TD&gt;Difference&lt;/TD&gt;&lt;TD&gt;% Change&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2010&lt;/TD&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;2018-2010&lt;/TD&gt;&lt;TD&gt;Difference/2010&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;80,74&lt;/TD&gt;&lt;TD&gt;86,44&lt;/TD&gt;&lt;TD&gt;5,7&lt;/TD&gt;&lt;TD&gt;7,06%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 14:27:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255377#M54428</guid>
      <dc:creator>BICrazy</dc:creator>
      <dc:date>2021-12-24T14:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage Change from First to Last Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255382#M54429</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="108403" data-lia-user-login="BICrazy" class="lia-mention lia-mention-user"&gt;BICrazy&lt;/a&gt; , Try measure like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _max = maxx(allselected(Date),Date[Date])&lt;BR /&gt;var _min = minx(allselected(Date),Date[Date])&lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value Reff]), filter(allselected('Date'), 'Date'[Date]=_max)) - &lt;BR /&gt;calculate( sum(Table[Value Reff]), filter(allselected('Date'), 'Date'[Date]=_min))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new measure =&lt;BR /&gt;var _max = maxx(all(Date),Date[Date])&lt;BR /&gt;var _min = minx(all(Date),Date[Date])&lt;BR /&gt;return &lt;BR /&gt;calculate( sum(Table[Value Reff]), filter(all('Date'), 'Date'[Date]=_max)) - &lt;BR /&gt;calculate( sum(Table[Value Reff]), filter(all('Date'), 'Date'[Date]=_min))&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 14:35:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255382#M54429</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-12-24T14:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage Change from First to Last Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255434#M54431</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;All measures are in the attached pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 15:36:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255434#M54431</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-12-24T15:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage Change from First to Last Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255845#M54439</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp; Appreciate the response Jihwan.&amp;nbsp; This option would have also worked as a solution.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 08:00:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255845#M54439</guid>
      <dc:creator>BICrazy</dc:creator>
      <dc:date>2021-12-26T08:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percentage Change from First to Last Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255851#M54440</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; Thanks a mill.&amp;nbsp; This solution worked like a charm.&amp;nbsp; I just hard-coded the year's as my dataset min year starts at 1960 and max year ends at 2020.&lt;BR /&gt;&lt;BR /&gt;Here is the sample of my Dax:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;% Change GDP per capita, PPP (current international $) = 
var _min = YEAR( " December 2010" )
var _max = YEAR( "December 2018" )
var _calc =calculate( [Private health expenditure (% of current health expenditure)], filter(ALL( Data_WB_HNP_WDI), Data_WB_HNP_WDI[Year]=_max)) -
calculate( [Private health expenditure (% of current health expenditure)], filter(ALL( Data_WB_HNP_WDI), Data_WB_HNP_WDI[Year]=_min))

return
DIVIDE( _calc, calculate( [Private health expenditure (% of current health expenditure)], filter(ALL( Data_WB_HNP_WDI), Data_WB_HNP_WDI[Year]=_min)), 0 )&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Solution:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Dec 2021 08:03:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percentage-Change-from-First-to-Last-Date/m-p/2255851#M54440</guid>
      <dc:creator>BICrazy</dc:creator>
      <dc:date>2021-12-26T08:03:05Z</dc:date>
    </item>
  </channel>
</rss>

