<?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: Filter on multiple dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-multiple-dates/m-p/2070543#M46834</link>
    <description>&lt;P&gt;SAMEPERIODLASTYEAR()&lt;/P&gt;</description>
    <pubDate>Sat, 11 Sep 2021 20:52:40 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2021-09-11T20:52:40Z</dc:date>
    <item>
      <title>Filter on multiple dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-multiple-dates/m-p/2062192#M46553</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to count the number of subscriptions (=Y)in at a given point (19/08/2021) in time while only taking into account the courses started between 01/07/2021 and 31/12/2021. Then I want to compare this with the number of subscriptions in given point in time Y-1 (19/08/2020) while taking into account the courses started between 01/07/2020 and 31/12/2021.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt; I have 2 date tables to filter:&amp;nbsp;dim&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;SubscriptionDate and dim StartDateCourse&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;--&amp;gt; I have 1 fact table: fact Subscriptions (with the&amp;nbsp;SubscriptionDate and&amp;nbsp;StartDateCourse as variables)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;--&amp;gt; I have a filter in my dashboard with&amp;nbsp;SubscriptionDate&amp;lt;19/08/2021&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;--&amp;gt; I have a filter in my dashboard with StartDateCourse: 2021, Semester 2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on these filters i want to obtain the following tablestructure: Semester, Y, Y-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below the Y, but I have no idea how to make the Y-1 in a way that I go one year back for both the&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;SubscriptionDate and&amp;nbsp;StartDateCourse.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Anyone who can help me?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;Y = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR &lt;SPAN&gt;maxSubscriptionDate&lt;/SPAN&gt;= max('dim &lt;SPAN&gt;SubscriptionDate&lt;/SPAN&gt;'[&lt;SPAN&gt;DateSubscription&lt;/SPAN&gt;])&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;CALCULATE(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT('fact Subscriptions'[SubsriptionID]),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER('fact Subscriptions',&lt;/SPAN&gt;&lt;SPAN&gt;'fact Subscriptions'[DateSubscription]&amp;lt;maxSubscriptionDate)&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Sep 2021 15:43:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-multiple-dates/m-p/2062192#M46553</guid>
      <dc:creator>overmeer</dc:creator>
      <dc:date>2021-09-07T15:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter on multiple dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-multiple-dates/m-p/2070543#M46834</link>
      <description>&lt;P&gt;SAMEPERIODLASTYEAR()&lt;/P&gt;</description>
      <pubDate>Sat, 11 Sep 2021 20:52:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-on-multiple-dates/m-p/2070543#M46834</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-09-11T20:52:40Z</dc:date>
    </item>
  </channel>
</rss>

