<?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 Need Last Year 4 Week Aggregate in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735508#M1998</link>
    <description>&lt;P&gt;How can I create a calculation that looks back one year and then does a 4 week aggregate?&lt;/P&gt;&lt;P&gt;We do not use a standard calendar so some of the DAX functions do not work becauses of this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently this is what I use for a 4 week/28 day aggregate.&amp;nbsp; How can I add the Last Year look back to this?&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;BR /&gt;[Sales],&lt;BR /&gt;DATESINPERIOD (&lt;BR /&gt;'Calendar - Fiscal'[Date],&lt;BR /&gt;LASTDATE ( 'Calendar - Fiscal'[Date] ),&lt;BR /&gt;-28,&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 15:30:52 GMT</pubDate>
    <dc:creator>pokdbz</dc:creator>
    <dc:date>2019-07-09T15:30:52Z</dc:date>
    <item>
      <title>Need Last Year 4 Week Aggregate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735508#M1998</link>
      <description>&lt;P&gt;How can I create a calculation that looks back one year and then does a 4 week aggregate?&lt;/P&gt;&lt;P&gt;We do not use a standard calendar so some of the DAX functions do not work becauses of this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently this is what I use for a 4 week/28 day aggregate.&amp;nbsp; How can I add the Last Year look back to this?&lt;/P&gt;&lt;P&gt;CALCULATE (&lt;BR /&gt;[Sales],&lt;BR /&gt;DATESINPERIOD (&lt;BR /&gt;'Calendar - Fiscal'[Date],&lt;BR /&gt;LASTDATE ( 'Calendar - Fiscal'[Date] ),&lt;BR /&gt;-28,&lt;BR /&gt;DAY&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 15:30:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735508#M1998</guid>
      <dc:creator>pokdbz</dc:creator>
      <dc:date>2019-07-09T15:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last Year 4 Week Aggregate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735551#M2000</link>
      <description>&lt;P&gt;What does it mean when you say "last year"? Are you talking about the usual year shift in the ordinary calendar or something like a custom year (say, fiscal)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735551#M2000</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T16:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last Year 4 Week Aggregate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735552#M2001</link>
      <description>&lt;P&gt;For a regular calendar this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[Measure] =
CALCULATE (
    [Sales],
    DATESINPERIOD (
        'Calendar - Fiscal'[Date],
        SAMEPERIODLASTYEAR( LASTDATE ( 'Calendar - Fiscal'[Date] ) ),
        -28,
        DAY
    )
)&lt;/PRE&gt;&lt;P&gt;But beware! If the dates go off the beginning of the calendar, you will not get a full 28-day period. You have to decide what you want to do in case the shift does not return 28 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also hope that 'Calendar - Fiscal' is a PROPER DATE TABLE and is marked as such. Otherwise, this stuff will not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:13:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735552#M2001</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last Year 4 Week Aggregate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735569#M2005</link>
      <description>&lt;P&gt;Maybe this would help you?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=wHn968f1E58" target="_blank"&gt;https://www.youtube.com/watch?v=wHn968f1E58&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:26:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735569#M2005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T16:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last Year 4 Week Aggregate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735584#M2008</link>
      <description>&lt;P&gt;This is a proper date table, but its not a standard Calendar table.&amp;nbsp; Its a Fiscal Calendar so alot of the functions will not work.&amp;nbsp; We cannot hard coded dates either because the next year does not start and end on the same as the previous year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:41:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735584#M2008</guid>
      <dc:creator>pokdbz</dc:creator>
      <dc:date>2019-07-09T16:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last Year 4 Week Aggregate</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735590#M2010</link>
      <description>&lt;P&gt;To be able to move in time in a custom calendar you need to create columns that will enable this. For instance, all days should have attributes like: FiscalYearNumber, FiscalYearName, FiscalMonthNumberInYear, FiscalMonthConsecutiveNumberAcrossAllYears,....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have them (please have a look at the YT vid link I've sent you before), then and only then can you build your calculations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For calculations when using custom calendars please go to&amp;nbsp;&lt;A href="https://www.daxpatterns.com/time-patterns/#period-comparison-pattern" target="_self"&gt;Period Comparison Patterns with Custom Calendars&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 16:55:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Last-Year-4-Week-Aggregate/m-p/735590#M2010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T16:55:45Z</dc:date>
    </item>
  </channel>
</rss>

