<?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 Percent Change in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198925#M51567</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340031" data-lia-user-login="natasha519" class="lia-mention lia-mention-user"&gt;natasha519&lt;/a&gt; , if it is year level, you can manage it with a separate year table, but use separate year table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I told in last how to get date from month year. This can done with date or year table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;diff = [This Year]-[Last Year ]&lt;BR /&gt;diff % = divide([This Year]-[Last Year ],[Last Year ])&lt;/P&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Year on Year with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=km41KfM_0uA" target="_blank"&gt;https://www.youtube.com/watch?v=km41KfM_0uA&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2021 16:24:08 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-11-19T16:24:08Z</dc:date>
    <item>
      <title>Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198711#M51554</link>
      <description>&lt;P&gt;I'm pretty new to Power BI - I have a dataset that has Month, Year, Predicted Value, and Data Value all in their own columns. How would I calcuate the percent change for the predicted value and Data value from April 2020 to April 2021?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 14:21:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198711#M51554</guid>
      <dc:creator>natasha519</dc:creator>
      <dc:date>2021-11-19T14:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198855#M51558</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340031" data-lia-user-login="natasha519" class="lia-mention lia-mention-user"&gt;natasha519&lt;/a&gt; , You want MOM Change %&amp;nbsp; ?&lt;/P&gt;
&lt;P&gt;First Create a date using month and year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date = "01-"&amp;amp;[Month]&amp;amp;"-" &amp;amp;[Year] //Change data type to date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Join with Date table and use time intelligence&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))&lt;BR /&gt;last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))&lt;BR /&gt;next month Sales = CALCULATE(SUM(Sales[Sales Amount]),nextmonth('Date'[Date]))&lt;BR /&gt;this month = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH('Date'[Date])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Month on Month with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=6LUBbvcxtKA" target="_blank"&gt;https://www.youtube.com/watch?v=6LUBbvcxtKA&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 15:42:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198855#M51558</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-11-19T15:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198883#M51561</link>
      <description>&lt;P&gt;I want YOY change! Also is a date table required? I have month and year columns in the same table&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 15:58:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198883#M51561</guid>
      <dc:creator>natasha519</dc:creator>
      <dc:date>2021-11-19T15:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198925#M51567</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340031" data-lia-user-login="natasha519" class="lia-mention lia-mention-user"&gt;natasha519&lt;/a&gt; , if it is year level, you can manage it with a separate year table, but use separate year table &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I told in last how to get date from month year. This can done with date or year table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Only year vs Year, not a level below&lt;/P&gt;
&lt;P&gt;This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))&lt;BR /&gt;Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;diff = [This Year]-[Last Year ]&lt;BR /&gt;diff % = divide([This Year]-[Last Year ],[Last Year ])&lt;/P&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Power BI — Year on Year with or Without Time Intelligence &lt;BR /&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=km41KfM_0uA" target="_blank"&gt;https://www.youtube.com/watch?v=km41KfM_0uA&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 16:24:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2198925#M51567</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-11-19T16:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2202751#M51733</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340031" data-lia-user-login="natasha519" class="lia-mention lia-mention-user"&gt;natasha519&lt;/a&gt;&amp;nbsp;；&lt;/P&gt;
&lt;P&gt;I think it isn't necessary to use another date table. Secondly, do you mean to change the percentage of each state? If yes, I created the following measure according to the screenshot you provided.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;fact% = 
var _last=CALCULATE(SUM([Data Value]),FILTER(ALLEXCEPT('Table','Table'[State N]),[Year]=MAX('Table'[Year])-1&amp;amp;&amp;amp;[Month]="April"))
return DIVIDE(SUM([Data Value])-_last,_last)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;Predicted% = 
var _last=CALCULATE(SUM([Predicted Value]),FILTER(ALLEXCEPT('Table','Table'[State N]),[Year]=MAX('Table'[Year])-1&amp;amp;&amp;amp;[Month]="April"))
return DIVIDE(SUM([Predicted Value])-_last,_last)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;The final output is shown below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If not, can you provide simple scenarios (about simple sample screenshots and what you want to output)? Looking forward to your reply！&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Community Support Team_ Yalan Wu&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&lt;EM&gt;&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 03:12:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2202751#M51733</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2021-11-23T03:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2212215#M52230</link>
      <description>&lt;P&gt;Hello! Apologize for the late response, I changed around the format of the table a bit in Power BI to hopefully make the calculations easier!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are now only 4 columns which you can see above. I also have created some measure which gives me a 1 if the date was last year (April 2020) and then I have another measure which gives me a 1 if the date is the latest date (April 2021). The last measure is the sum of both of these and gives me a 1 for both April 2020 and now April 2021. I would like to calculate the percent change for the Predicted Value for each recipient from April 2020 to April 2021 and then same for Reported Value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially I would like a 4th column in this matrix below for percent change for the row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:59:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2212215#M52230</guid>
      <dc:creator>natasha519</dc:creator>
      <dc:date>2021-11-29T14:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2212939#M52275</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340031" data-lia-user-login="natasha519" class="lia-mention lia-mention-user"&gt;natasha519&lt;/a&gt;&amp;nbsp;；&lt;/P&gt;
&lt;P&gt;You could create a measure.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Measure = 
var _2021=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Attribute]),YEAR([Date])=2021&amp;amp;&amp;amp;MONTH([Date])=4))
var _2020=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Attribute]),YEAR([Date])=2020&amp;amp;&amp;amp;MONTH([Date])=4))
return IF(ISINSCOPE('Table'[Date]),SUM([Value]),FORMAT( DIVIDE( _2021- _2020,_2020),"0.00%"))&lt;/LI-CODE&gt;
&lt;P&gt;The final output is shown below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team_ Yalan Wu&lt;BR /&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 as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 02:06:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2212939#M52275</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2021-11-30T02:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2214289#M52342</link>
      <description>&lt;P&gt;This makes sense, but how can I incorporate a measure within the formula which already calculates the latest date in 2021 and then 1 year from latest date? The month will not always be 4.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I keep getting the error "A function PLACEHOLDER has been used in a True/False expression that is used as a table filter expression. This is not allowed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one measure called LastYear which returns a 1 for April 2020 currently, and then I have another measure called LatestDate which returns a 1 for April 2021 currently. The last measure is LastYear plus LatestDate which is just the sum of the two measures and returns a 1 for both April 2020 and April 2021.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 14:51:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2214289#M52342</guid>
      <dc:creator>natasha519</dc:creator>
      <dc:date>2021-11-30T14:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Percent Change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2215376#M52419</link>
      <description>&lt;P&gt;Hi，&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340031" data-lia-user-login="natasha519" class="lia-mention lia-mention-user"&gt;natasha519&lt;/a&gt;&amp;nbsp;；&lt;/P&gt;
&lt;P&gt;Please try modify it.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _last=CALCULATE( LASTDATE('Table'[Date]),ALL('Table'))
var _2021=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Attribute]),EOMONTH([Date],0)=EOMONTH(_last,0)))
var _2020=CALCULATE(SUM([Value]),FILTER(ALLEXCEPT('Table','Table'[Attribute]),EOMONTH([Date],0)=EOMONTH(_last,-12)))
return IF(EOMONTH(MAX([Date]),0)=EOMONTH(_last,0)||EOMONTH(MAX([Date]),0)=EOMONTH(_last,-12), IF(ISINSCOPE('Table'[Date]),SUM([Value]),FORMAT( DIVIDE( _2021- _2020,_2020),"0.00%")))&lt;/LI-CODE&gt;
&lt;P&gt;The final output is shown below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The formula is dynamic, the last month in the table is the same month in the previous year. If you still have errors, could you please take a screenshot to see the error prompt and more details?&lt;BR /&gt;Best Regards,&lt;BR /&gt;Community Support Team_ Yalan Wu&lt;BR /&gt;If this post&lt;EM&gt;&lt;STRONG&gt; helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt; &lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 05:24:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-Percent-Change/m-p/2215376#M52419</guid>
      <dc:creator>v-yalanwu-msft</dc:creator>
      <dc:date>2021-12-01T05:24:13Z</dc:date>
    </item>
  </channel>
</rss>

