<?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 CAGR% for Moving Annual Total Dynamic formula in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2562906#M72956</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329452" data-lia-user-login="enghone09" class="lia-mention lia-mention-user"&gt;enghone09&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="394819" data-lia-user-login="enghone007" class="lia-mention lia-mention-user"&gt;enghone007&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please change M codes as below:&lt;BR /&gt;Period Year:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Text.From(Date.Year(Date.AddMonths([Date], 1 + (Date.Month(DateTime.LocalNow())))))&lt;/LI-CODE&gt;
&lt;P&gt;Dynamic Period:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Text.Combine(
      {
        "MAT",
        Text.From(Date.Year(Date.AddMonths([Date], 1 + (Date.Month(DateTime.LocalNow()))))),
        Date.MonthName(Date.AddMonths(DateTime.LocalNow(), - 1))
      },
      " "
    )&lt;/LI-CODE&gt;
&lt;P&gt;(&lt;SPAN&gt;MAT May 2022&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then replace the fields in my original Dax formulas with these new fields.&lt;/P&gt;
&lt;P&gt;Please check my sample file for more details.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 06:31:03 GMT</pubDate>
    <dc:creator>v-easonf-msft</dc:creator>
    <dc:date>2022-06-07T06:31:03Z</dc:date>
    <item>
      <title>Calculate CAGR% for Moving Annual Total Dynamic formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2543638#M71718</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to find an answer for the CAGR calculation that I need but I wasn't able to find a solution. So I am hoping someone can help me. I used the following video to build by Dynamic CAGR% model but it is not working for what I need.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=IUdsztn62aA" target="_blank"&gt;https://www.youtube.com/watch?v=IUdsztn62aA&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me explain&lt;/P&gt;&lt;P&gt;I want to calculate CAGR for moving 12 months. For example, say the latest data period I have is till April 2022, I want to calculate CAGR using starting year April 2019 or April 2018. How do I make the start year and month to be dynamic based on the end year and month? And then the next following month in May, I want to use May 2022 MAT period.&lt;BR /&gt;&lt;BR /&gt;Do I need a MAT year column in my date table? If so, how do I write M query for that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any solution is welcome. Appreciate your help. Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 10:56:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2543638#M71718</guid>
      <dc:creator>enghone007</dc:creator>
      <dc:date>2022-05-27T10:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate CAGR% for Moving Annual Total Dynamic formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2547591#M71987</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="394819" data-lia-user-login="enghone007" class="lia-mention lia-mention-user"&gt;enghone007&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try the following M query&amp;nbsp;to offset your original field ‘Year’ based on the current month.:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Date.Year(Date.AddMonths([Date], -(Date.Month(DateTime.LocalNow()))))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then you can replace your original filed 'Year' with new field 'Period' in your model.&lt;/P&gt;
&lt;P&gt;Meaure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ending Period = CALCULATE(MAX('Revenue'[Dynamic Period] ),ALL('Revenue'[Dynamic Period]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Ending Period Value = CALCULATE([Total Revenue],FILTER(ALL(Revenue[Dynamic Period]),Revenue[Dynamic Period]=Revenue[Ending Period]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;No.of Periods -1 = [Ending Period]-VALUES('Period Table'[Dynamic Period])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Starting Period Value = CALCULATE('Period Table'[Total Revenue],FILTER(ALL(Revenue[Dynamic Period]),Revenue[Dynamic Period]= VALUES('Period Table'[Dynamic Period]) ))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;CAGR = ([Ending Period Value]/[Starting Period Value])^(1/[No.of Periods -1])-1&lt;/LI-CODE&gt;
&lt;P&gt;Please check my sample file for more details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 10:43:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2547591#M71987</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-05-30T10:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate CAGR% for Moving Annual Total Dynamic formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2552657#M72294</link>
      <description>&lt;P&gt;Thank you for your help. but Mquery doesn't give me the period that I need. So for example&lt;BR /&gt;&lt;BR /&gt;May-2021&lt;/P&gt;&lt;P&gt;Jun-2021&lt;/P&gt;&lt;P&gt;Jul-2021&lt;/P&gt;&lt;P&gt;Aug-2021&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;April 2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The whole twelve months I want the column to show "MAT April 2022". And then when May 2022 data is available, i want the data to go 12 months back.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 11:16:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2552657#M72294</guid>
      <dc:creator>enghone09</dc:creator>
      <dc:date>2022-06-01T11:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate CAGR% for Moving Annual Total Dynamic formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2562906#M72956</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329452" data-lia-user-login="enghone09" class="lia-mention lia-mention-user"&gt;enghone09&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="394819" data-lia-user-login="enghone007" class="lia-mention lia-mention-user"&gt;enghone007&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please change M codes as below:&lt;BR /&gt;Period Year:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Text.From(Date.Year(Date.AddMonths([Date], 1 + (Date.Month(DateTime.LocalNow())))))&lt;/LI-CODE&gt;
&lt;P&gt;Dynamic Period:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=Text.Combine(
      {
        "MAT",
        Text.From(Date.Year(Date.AddMonths([Date], 1 + (Date.Month(DateTime.LocalNow()))))),
        Date.MonthName(Date.AddMonths(DateTime.LocalNow(), - 1))
      },
      " "
    )&lt;/LI-CODE&gt;
&lt;P&gt;(&lt;SPAN&gt;MAT May 2022&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then replace the fields in my original Dax formulas with these new fields.&lt;/P&gt;
&lt;P&gt;Please check my sample file for more details.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Eason&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 06:31:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/2562906#M72956</guid>
      <dc:creator>v-easonf-msft</dc:creator>
      <dc:date>2022-06-07T06:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate CAGR% for Moving Annual Total Dynamic formula</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/3405522#M128669</link>
      <description>&lt;P&gt;Thank you so much. It definitely help solved the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 00:59:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-CAGR-for-Moving-Annual-Total-Dynamic-formula/m-p/3405522#M128669</guid>
      <dc:creator>enghone09</dc:creator>
      <dc:date>2023-08-30T00:59:35Z</dc:date>
    </item>
  </channel>
</rss>

