<?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: Three year Average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803491#M4912</link>
    <description>&lt;P&gt;I forgot to mention that I have Report level filter to show only data from 2019.Q2 as we are going live/production with 2019.Q2 eventhough we have data previous years for Averages.&lt;/P&gt;&lt;P&gt;So I wanted to include logic to ignore Report level.Page level filters to get LY, LLY Sales.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2019 20:10:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-26T20:10:58Z</dc:date>
    <item>
      <title>Three year Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803246#M4904</link>
      <description>&lt;P&gt;Hi, I need help with calculating 3-year average for selected Quarter.&lt;/P&gt;&lt;P&gt;If a user selects 2019.Q2 reporting period, then I want average of 2017.Q2, 2018.Q2, and 2019.Q2&lt;/P&gt;&lt;P&gt;I have a DATE table and slicer values are based on this DATE table.&lt;/P&gt;&lt;P&gt;I want output as shown in the picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've Sales Measure&lt;/P&gt;&lt;P&gt;for LYSales am using SAMEPERIODLASTYEAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 15:19:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803246#M4904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-26T15:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Three year Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803491#M4912</link>
      <description>&lt;P&gt;I forgot to mention that I have Report level filter to show only data from 2019.Q2 as we are going live/production with 2019.Q2 eventhough we have data previous years for Averages.&lt;/P&gt;&lt;P&gt;So I wanted to include logic to ignore Report level.Page level filters to get LY, LLY Sales.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 20:10:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803491#M4912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-26T20:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Three year Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803556#M4916</link>
      <description>&lt;P&gt;Here is the solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LLYSales = CALCULATE([Sales],&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FILTER(ALL(dates), AND (Dates[Year] = SELECTEDVALUE(Dates[Year],ERROR("Please select Reporting Period"))-2,&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dates[Quarter]=SELECTEDVALUE(Dates[Quarter],ERROR("Please select Reporting Period")))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If I use SELECTEDVALUE directly then only am getting correct output instead if I pass Measures which stores selected value of Year and Quarter its not working.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I verified YearSlected, QuarterSelected measures by placing on to a Card and am seeing correct values as 2019, and 2.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;First I started testing with this below query:&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;LLYSalesTest = CALCULATE([Saless],ALL(dates),Dates[Year]=2017, Dates[Quarter]=2) -- Prev Prev Year (2019-2)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All these Dates (Year and Quarter) are from DATE table, not Fact table.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 28 Sep 2019 14:57:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Three-year-Average/m-p/803556#M4916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-28T14:57:57Z</dc:date>
    </item>
  </channel>
</rss>

