<?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 Last 12 Complete Month Rolling Filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1839555#M39234</link>
    <description>&lt;P&gt;Hello, I have a visual where I would like to display only data for the last 12 &lt;U&gt;complete&lt;/U&gt; months. For example, if today is 5/12/2021, the data I would like to be displayed would be running from 4/1/2020 to 4/30/2021. Every month has a full month's worth of data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I have this DAX, but PBI gives me errors on formatting and values when comparing the dates for some reason.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rolling 12 Month Ind = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Start_Date = DATE(YEAR(TODAY()-1),MONTH(TODAY())-1,1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /*Returns date 13 months ago and at beginning of month. Made sure to start at beginning of month to make sure month is complete*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR End_Date = EOMonth(TODAY(), -1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /*Not sure if this is the best route, because if TODAY() is the end of the month already, I would like to include that data.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF(Start_Date &amp;lt;= SELECTEDVALUE(Sales[Date_Sold &amp;lt;= End_Date, 1, 0)&lt;BR /&gt;&lt;BR /&gt;Any suggestions on how to tweak this indicator for filtering? Thank you in advance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 May 2021 22:58:27 GMT</pubDate>
    <dc:creator>matsahiro</dc:creator>
    <dc:date>2021-05-12T22:58:27Z</dc:date>
    <item>
      <title>Last 12 Complete Month Rolling Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1839555#M39234</link>
      <description>&lt;P&gt;Hello, I have a visual where I would like to display only data for the last 12 &lt;U&gt;complete&lt;/U&gt; months. For example, if today is 5/12/2021, the data I would like to be displayed would be running from 4/1/2020 to 4/30/2021. Every month has a full month's worth of data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now I have this DAX, but PBI gives me errors on formatting and values when comparing the dates for some reason.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rolling 12 Month Ind = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Start_Date = DATE(YEAR(TODAY()-1),MONTH(TODAY())-1,1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /*Returns date 13 months ago and at beginning of month. Made sure to start at beginning of month to make sure month is complete*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR End_Date = EOMonth(TODAY(), -1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /*Not sure if this is the best route, because if TODAY() is the end of the month already, I would like to include that data.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF(Start_Date &amp;lt;= SELECTEDVALUE(Sales[Date_Sold &amp;lt;= End_Date, 1, 0)&lt;BR /&gt;&lt;BR /&gt;Any suggestions on how to tweak this indicator for filtering? Thank you in advance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 May 2021 22:58:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1839555#M39234</guid>
      <dc:creator>matsahiro</dc:creator>
      <dc:date>2021-05-12T22:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Complete Month Rolling Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1839598#M39236</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283592" data-lia-user-login="matsahiro" class="lia-mention lia-mention-user"&gt;matsahiro&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please use the following formula to have the desired results:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rolling 12 Month Ind = 
VAR CurrentDate =  SELECTEDVALUE(Sales[Date_Sold])
VAR Start_Date =
    EOMONTH( TODAY() , -14 )+1    
VAR End_Date =
    EOMONTH ( TODAY(), -1 )
RETURN

IF ( CurrentDate &amp;gt;= Start_Date &amp;amp;&amp;amp;  CurrentDate &amp;lt;= End_Date, 1, 0 )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 00:25:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1839598#M39236</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2021-05-13T00:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Complete Month Rolling Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1840059#M39249</link>
      <description>&lt;P&gt;This is the DAX forum so it's no surprise you've got a DAX answer.&amp;nbsp; I'd just point out this functionality is available in the UI.&amp;nbsp; Use a relative date slicer or filter with calendar month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 06:59:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1840059#M39249</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-05-13T06:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Complete Month Rolling Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1840791#M39266</link>
      <description>&lt;P&gt;Hi Paul. You are correct that it is available in the UI. But if you notice, this does not meet my requirements as the data that is being filtered in does not start at the beginning and end of each month.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 13:29:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1840791#M39266</guid>
      <dc:creator>matsahiro</dc:creator>
      <dc:date>2021-05-13T13:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Complete Month Rolling Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1841211#M39282</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283592" data-lia-user-login="matsahiro" class="lia-mention lia-mention-user"&gt;matsahiro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you tried my solution to your problem, let me know if it works.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 17:10:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1841211#M39282</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2021-05-13T17:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Complete Month Rolling Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1841423#M39289</link>
      <description>&lt;P&gt;Definitely gave it a go. The IF statement ended up not working for a specific visual I had, but I simply threw in the same logic in a CALCULATE statement.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Rolling 12 Month Count = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Start_Date = EOMONTH(TODAY(), -14)+1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR End_Date = TODAY()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(COUNT(Table[Column]), Table[Column] &amp;gt;= Start_Date &amp;amp;&amp;amp; Table[Date] &amp;lt;= End_Date)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you very much for the help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 May 2021 19:52:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-Complete-Month-Rolling-Filter/m-p/1841423#M39289</guid>
      <dc:creator>matsahiro</dc:creator>
      <dc:date>2021-05-13T19:52:17Z</dc:date>
    </item>
  </channel>
</rss>

