<?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: Calculating % Change from Previous Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4380302#M173878</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="531109" data-lia-user-login="e175429" class="lia-mention lia-mention-user"&gt;e175429&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try these measures:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Served = SUM ( 'Table'[Total Served] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Percent Change from PY =
VAR vCY =
    MAX ( 'Table'[Year] )
VAR vCYAmount = [Total Served]
VAR vPYAmount =
    CALCULATE ( [Total Served], 'Table'[Year] = vCY - 1 )
VAR vResult =
    IF (
        HASONEVALUE ( 'Table'[Year] ),
        DIVIDE ( vCYAmount - vPYAmount, vPYAmount )
    )
RETURN
    vResult&lt;/LI-CODE&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;For future reference, you can copy your data and paste using the Table icon rather than a screenshot.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2025 19:28:01 GMT</pubDate>
    <dc:creator>DataInsights</dc:creator>
    <dc:date>2025-01-24T19:28:01Z</dc:date>
    <item>
      <title>Calculating % Change from Previous Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4380203#M173873</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my current table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a column that shows the % change from previous year for each section.&lt;/P&gt;&lt;P&gt;Currently, I have no measures created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my data:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would upload the BI file but you have to be a SuperUser to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help in pointing me in the right direction would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 17:20:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4380203#M173873</guid>
      <dc:creator>e175429</dc:creator>
      <dc:date>2025-01-24T17:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating % Change from Previous Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4380302#M173878</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="531109" data-lia-user-login="e175429" class="lia-mention lia-mention-user"&gt;e175429&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try these measures:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Served = SUM ( 'Table'[Total Served] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Percent Change from PY =
VAR vCY =
    MAX ( 'Table'[Year] )
VAR vCYAmount = [Total Served]
VAR vPYAmount =
    CALCULATE ( [Total Served], 'Table'[Year] = vCY - 1 )
VAR vResult =
    IF (
        HASONEVALUE ( 'Table'[Year] ),
        DIVIDE ( vCYAmount - vPYAmount, vPYAmount )
    )
RETURN
    vResult&lt;/LI-CODE&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;For future reference, you can copy your data and paste using the Table icon rather than a screenshot.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 19:28:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4380302#M173878</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2025-01-24T19:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating % Change from Previous Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4381362#M173932</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="531109" data-lia-user-login="e175429" class="lia-mention lia-mention-user"&gt;e175429&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please use below dax formula&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;YoY % =&lt;BR /&gt;VAR CurrentYear = MAX('Sales'[Year])&lt;BR /&gt;VAR PreviousYear = CurrentYear - 1&lt;/P&gt;&lt;P&gt;VAR CurrentYearSales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Sales'[Sales Amount]),&lt;BR /&gt;'Sales'[Year] = CurrentYear&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR PreviousYearSales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Sales'[Sales Amount]),&lt;BR /&gt;'Sales'[Year] = PreviousYear&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(PreviousYearSales),&lt;BR /&gt;DIVIDE(CurrentYearSales - PreviousYearSales, PreviousYearSales, 0),&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Govind Sapkade ( Data Analyst , Power BI PL 300 Certified , MS Fabric Enthusiast )&lt;BR /&gt;Linkdin :&amp;nbsp;&lt;A href="http://www.linkedin.com/in/govind-sapkade-845104225" target="_blank"&gt;www.linkedin.com/in/govind-sapkade-845104225&lt;/A&gt;&lt;BR /&gt;Youtube :&amp;nbsp;&lt;A href="http://www.youtube.com/@govind_dataanalyst" target="_blank"&gt;http://www.youtube.com/@govind_dataanalyst&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2025 17:41:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4381362#M173932</guid>
      <dc:creator>govind_021</dc:creator>
      <dc:date>2025-01-26T17:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating % Change from Previous Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4383062#M173974</link>
      <description>&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 18:53:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4383062#M173974</guid>
      <dc:creator>e175429</dc:creator>
      <dc:date>2025-01-27T18:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating % Change from Previous Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4383064#M173975</link>
      <description>&lt;P&gt;Your solution worked as well. Thank you kindly&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 18:53:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Change-from-Previous-Year/m-p/4383064#M173975</guid>
      <dc:creator>e175429</dc:creator>
      <dc:date>2025-01-27T18:53:46Z</dc:date>
    </item>
  </channel>
</rss>

