<?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: Aggregation for Same Period Last Year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2490018#M68520</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you mean that the calculation of &lt;STRONG&gt;[Actual TRG AGG-1]&lt;/STRONG&gt; is wrong and not cumulative? Please update its formula as below and check whether it can return the correct result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Actual TRG AGG-1 =
VAR _selyear =
    SELECTEDVALUE ( 'Calendar'[Date].[Year] )
VAR _selmonth =
    SELECTEDVALUE ( 'Calendar'[Date].[MonthNo] )
RETURN
    CALCULATE (
        [Actual TRG],
        FILTER (
            ALLSELECTED ( 'SALES' ),
            'SALES'[LOB] = SELECTEDVALUE ( 'SALES'[LOB] )
                &amp;amp;&amp;amp; YEAR ( 'SALES'[Date] ) = _selyear - 1
                &amp;amp;&amp;amp; MONTH ( 'SALES'[Date] ) &amp;lt;= _selmonth
        )
    )&lt;/LI-CODE&gt;
&lt;DIV&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some &lt;STRONG&gt;sample data&lt;/STRONG&gt; in your tables &lt;EM&gt;SALES&lt;/EM&gt;, &lt;EM&gt;Conversion_Table_TRG&lt;/EM&gt; and &lt;EM&gt;Territory3&lt;/EM&gt; (&lt;EM&gt;&lt;STRONG&gt;exclude &lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;sensitive &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/EM&gt;) with &lt;STRONG&gt;Text&lt;/STRONG&gt; format and your &lt;STRONG&gt;expected result&lt;/STRONG&gt; with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 05:51:22 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-03T05:51:22Z</dc:date>
    <item>
      <title>Aggregation for Same Period Last Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2482389#M68011</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an aggregate measure accumulating the sales as the months go on called "Actual TRG AGG"&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I've highlighted above the portion relating to the Aggregating element but when I try to create the same measure for the year before:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;You can see that I'm not able to maintain the aggregating element.. how do I keep the aggregation in the -1 measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Eyal&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 07:49:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2482389#M68011</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-28T07:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation for Same Period Last Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2482632#M68026</link>
      <description>&lt;P&gt;I know it has to do with that ALLSELECTED which keeps me on the selected 2022 and for Jan,Feb and Mar... but I need to keep it there but perhaps add an except element for the year?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 08:56:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2482632#M68026</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-28T08:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation for Same Period Last Year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2490018#M68520</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you mean that the calculation of &lt;STRONG&gt;[Actual TRG AGG-1]&lt;/STRONG&gt; is wrong and not cumulative? Please update its formula as below and check whether it can return the correct result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Actual TRG AGG-1 =
VAR _selyear =
    SELECTEDVALUE ( 'Calendar'[Date].[Year] )
VAR _selmonth =
    SELECTEDVALUE ( 'Calendar'[Date].[MonthNo] )
RETURN
    CALCULATE (
        [Actual TRG],
        FILTER (
            ALLSELECTED ( 'SALES' ),
            'SALES'[LOB] = SELECTEDVALUE ( 'SALES'[LOB] )
                &amp;amp;&amp;amp; YEAR ( 'SALES'[Date] ) = _selyear - 1
                &amp;amp;&amp;amp; MONTH ( 'SALES'[Date] ) &amp;lt;= _selmonth
        )
    )&lt;/LI-CODE&gt;
&lt;DIV&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some &lt;STRONG&gt;sample data&lt;/STRONG&gt; in your tables &lt;EM&gt;SALES&lt;/EM&gt;, &lt;EM&gt;Conversion_Table_TRG&lt;/EM&gt; and &lt;EM&gt;Territory3&lt;/EM&gt; (&lt;EM&gt;&lt;STRONG&gt;exclude &lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;sensitive &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/EM&gt;) with &lt;STRONG&gt;Text&lt;/STRONG&gt; format and your &lt;STRONG&gt;expected result&lt;/STRONG&gt; with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 05:51:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Aggregation-for-Same-Period-Last-Year/m-p/2490018#M68520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-03T05:51:22Z</dc:date>
    </item>
  </channel>
</rss>

