<?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: DAX for month on month change in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759763#M85500</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help. I just modified a little to get my required result. It is giving the correct answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got a few questions after going through the attached pbix file and your code. Could you please help help me understand why it is happening ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) In the table, where you have created a column (&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;YYYYMM = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SRC&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)*&lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SRC&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;). How the value is coming 2022-09 ? there is no "-" in your code, still in the value it is coming. When I used YEAR(SRC[Date]), it is giving me value like 20-22 ? But when when we use YEAR[Date], it gives year value (2022) in other data model.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;2) in your code [&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;[Total]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SRC&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;__lwlm&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;() ], when I delete 3rd element of the calculate function, it gives error, and says, 3rd argument is compulsory. why ?&lt;BR /&gt;In calculate function, only first 2 arguments are compulsory as per microsoft document. I do not know why, we get such behavior.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;3) when I tried to sort YYYYMM col by Date col, then it gives me error like attached pick. Why ? what we should do to resolve ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;If you respond, would be very helpful.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 10 Sep 2022 18:14:13 GMT</pubDate>
    <dc:creator>Rahul_SC</dc:creator>
    <dc:date>2022-09-10T18:14:13Z</dc:date>
    <item>
      <title>DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759402#M85483</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;Can you guide me to create a dax formula for getting month on month change ? I can use calculate(sum, previousmonth(date)) function. but my requirement is slightly differenct.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Actually, I want to find out change in the last week of the each month; like below, I have a table where weekly data is reflecting, I want to find change % of last week of Nov data vs last week of October data then last week of Oct vs last week of September.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Value&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;04/09/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11/09/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 54&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;18/09/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25/09/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 44&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/10/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;09/10/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 32&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16/10/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 67&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;23/10/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 33&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30/10/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 68&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06/11/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 23&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;13/11/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 56&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/11/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 89&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;27/11/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 65&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04/12/2022&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; 43&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>Sat, 10 Sep 2022 08:34:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759402#M85483</guid>
      <dc:creator>Rahul_SC</dc:creator>
      <dc:date>2022-09-10T08:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759640#M85497</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 16:11:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759640#M85497</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2022-09-10T16:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759651#M85498</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for responding, however, the the value is incorrect.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;in the data, last week of Sep (25/09/2022) value is 44 and last week of Oct (30/10/2022) value is 68, so the % change should reflect Sep vs Oct (55%).&lt;BR /&gt;&lt;BR /&gt;And then last week of Oct (30/10/2022) value 68 vs last week of Nov (27/11/2022) value 65, % change should reflect (-4%).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 15:47:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759651#M85498</guid>
      <dc:creator>Rahul_SC</dc:creator>
      <dc:date>2022-09-10T15:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759763#M85500</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help. I just modified a little to get my required result. It is giving the correct answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got a few questions after going through the attached pbix file and your code. Could you please help help me understand why it is happening ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) In the table, where you have created a column (&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;YYYYMM = &lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SRC&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)*&lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SRC&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;). How the value is coming 2022-09 ? there is no "-" in your code, still in the value it is coming. When I used YEAR(SRC[Date]), it is giving me value like 20-22 ? But when when we use YEAR[Date], it gives year value (2022) in other data model.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;2) in your code [&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;[Total]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SRC&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;__lwlm&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;() ], when I delete 3rd element of the calculate function, it gives error, and says, 3rd argument is compulsory. why ?&lt;BR /&gt;In calculate function, only first 2 arguments are compulsory as per microsoft document. I do not know why, we get such behavior.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;3) when I tried to sort YYYYMM col by Date col, then it gives me error like attached pick. Why ? what we should do to resolve ?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;If you respond, would be very helpful.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Sep 2022 18:14:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759763#M85500</guid>
      <dc:creator>Rahul_SC</dc:creator>
      <dc:date>2022-09-10T18:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759821#M85502</link>
      <description>&lt;P&gt;For week-based calculations you need a weekly calendar like, say, ISO-week. Please have a look at this:&amp;nbsp;&lt;A href="https://www.daxpatterns.com/week-related-calculations/" target="_blank"&gt;Week-related calculations – DAX Patterns&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 20:51:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2759821#M85502</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-09-10T20:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2760117#M85517</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 08:46:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2760117#M85517</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2022-09-11T08:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for month on month change</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2761746#M85629</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your code is giving the answer, but when I make a relationship with calender table and then replaced date column used in the code with calender date column, it is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used different code as well which worked with same data set and gave the required result. Again, when I made relationship with calender table then not working. Do not know why ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing to add, in my source file, there are some repeated dates as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;by closing balance = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; Closing_Balance_Previous_Month=&lt;/SPAN&gt;&lt;SPAN&gt;CLOSINGBALANCEMONTH&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(SRC[Value]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(SRC[Date],-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,MONTH),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; Closing_Balance_Current_Month = &lt;/SPAN&gt;&lt;SPAN&gt;CLOSINGBALANCEMONTH&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(SRC[Value]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN&gt;(SRC[Date],&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,MONTH),&lt;/SPAN&gt;&lt;SPAN&gt;All&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Closing_Balance_Current_Month/Closing_Balance_Previous_Month-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Sep 2022 11:40:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-month-on-month-change/m-p/2761746#M85629</guid>
      <dc:creator>Rahul_SC</dc:creator>
      <dc:date>2022-09-12T11:40:25Z</dc:date>
    </item>
  </channel>
</rss>

