<?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: Percentage Change DAX formula in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386866#M174142</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343036" data-lia-user-login="mark_endicott" class="lia-mention lia-mention-user"&gt;mark_endicott&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2025 19:33:09 GMT</pubDate>
    <dc:creator>Nick221_</dc:creator>
    <dc:date>2025-01-29T19:33:09Z</dc:date>
    <item>
      <title>Percentage Change DAX formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386671#M174138</link>
      <description>&lt;P&gt;I have two measures "Start Month" and "End Month" in two cards. Below is the formula for these measures.&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;I have added two individual slicers by Month. Is it possible to calculate the percentage change of these two filtered measures, so that the formula will update depending on which month is selected from each?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table that is being filtered is titled "Date" filtered by column "Month".&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>Wed, 29 Jan 2025 16:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386671#M174138</guid>
      <dc:creator>Nick221_</dc:creator>
      <dc:date>2025-01-29T16:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Change DAX formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386716#M174139</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="429475" data-lia-user-login="Nick221_" class="lia-mention lia-mention-user"&gt;Nick221_&lt;/a&gt;&amp;nbsp;- try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR _change = [EndMonth] - [StartMonth] 
RETURN
DIVIDE( _change, [StartMonth] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this works, please mark it as he solution for others with the same challenge.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 17:19:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386716#M174139</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-01-29T17:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Change DAX formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386841#M174141</link>
      <description>&lt;P&gt;what does the _change represent in the divide calculation? I receive the below error.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 19:07:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386841#M174141</guid>
      <dc:creator>Nick221_</dc:creator>
      <dc:date>2025-01-29T19:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Change DAX formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386866#M174142</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343036" data-lia-user-login="mark_endicott" class="lia-mention lia-mention-user"&gt;mark_endicott&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 19:33:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4386866#M174142</guid>
      <dc:creator>Nick221_</dc:creator>
      <dc:date>2025-01-29T19:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Change DAX formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4387585#M174179</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="429475" data-lia-user-login="Nick221_" class="lia-mention lia-mention-user"&gt;Nick221_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a syntax error, you need to give the measure a name.&lt;/P&gt;
&lt;P&gt;For example,&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _change = [EndMonth] - [StartMonth] 
RETURN
DIVIDE( _change, [StartMonth] )&lt;/LI-CODE&gt;
&lt;P&gt;The _change is a&amp;nbsp;&lt;SPAN&gt;variable to store the value of the [EndMonth] - [StartMonth].&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this can help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&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;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 07:10:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4387585#M174179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-30T07:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Change DAX formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4387965#M174188</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="429475" data-lia-user-login="Nick221_" class="lia-mention lia-mention-user"&gt;Nick221_&lt;/a&gt;&amp;nbsp;- It's a variable (VAR) that stores a value. A.K.A we compute the difference or change between the start month &amp;amp; end month, store it and use it later in the DIVIDE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two issues with the code now:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) You have not kept the name of the measure, you have started with my variable&lt;/P&gt;
&lt;P&gt;2) I did not notice that you have a space in [End Month], but no space in [StartMonth] so the syntax error is also because this measure cannot find the [EndMonth] measure (it's actually called [End Month]).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This shoudl fix your issue:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pct Change = 
VAR _change = [End Month] - [StartMonth] 
RETURN
DIVIDE( _change, [StartMonth] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some more info: Variables are used in DAX to help with optimisation by storing values so that they do not need to be computed later in the calculation and to help with readability. In actual fact the most optimal version of the code I have given you is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pct Change = 
VAR _start = [StartMonth]
VAR _change = [End Month] - _start  
RETURN
DIVIDE( _change, _start  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This means that [Start Month] is only calculated once and stored, whereas in my earlier version it was calculated twice. I think this 2nd version is less readable however, and the difference it will make to the performance will be negligable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could write this calculation without variables (VAR) but this would be harder to read and understand at a glance:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pct Change = 

DIVIDE( [End Month] - [StartMonth] , [StartMonth]  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this now works, and provides some information on variables within DAX. If this has solved your issue, please accept it as the solution, so others with the same challenge can find the information.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 10:29:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-Change-DAX-formula/m-p/4387965#M174188</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2025-01-30T10:29:34Z</dc:date>
    </item>
  </channel>
</rss>

