<?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: Create custom date slicer based current selected periosd in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-custom-date-slicer-based-current-selected-periosd/m-p/2563434#M72990</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , try one of three options &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//previous period month &lt;BR /&gt;Same Date range last period = &lt;BR /&gt;var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1&lt;BR /&gt;var _p_st_date = MINX('Date',DATEADD('Date'[date],-1*_diff,Month))-1&lt;BR /&gt;var _p_end_date = MAXX('Date',DATEADD('Date'[date],-1*_diff,Month))-1&lt;BR /&gt;Return&lt;BR /&gt;CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]&amp;gt;=_p_st_date &amp;amp;&amp;amp; 'Date'[date]&amp;lt;= _p_end_date&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Same Date range last period Month = &lt;BR /&gt;var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1 &lt;BR /&gt;Return&lt;BR /&gt;CALCULATE(sum(Sales[Sales Amount]),dateadd('Date'[date],-1*_diff,Month))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same Date range last period = &lt;BR /&gt;var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1&lt;BR /&gt;var _p_st_date = Eomonth(MINX('Date','Date'[date], _1* _diff)-1&lt;BR /&gt;var _p_end_date = Eomonth(MAXX('Date','Date'[date], _1* _diff)&lt;BR /&gt;Return&lt;BR /&gt;CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]&amp;gt;=_p_st_date &amp;amp;&amp;amp; 'Date'[date]&amp;lt;= _p_end_date&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 09:12:35 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-06-07T09:12:35Z</dc:date>
    <item>
      <title>Create custom date slicer based current selected periosd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-custom-date-slicer-based-current-selected-periosd/m-p/2562684#M72948</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I wish to create a model with two date slicers (current and previous). Ideally, I want when I select on a date slicer between e.g 1/05/2022 to 31/05/2022 the previous date should dynamically move one month before. In other pages, I would like the previous date to be within the same period selected. For example, if i select 2 months on current date slicer, pevious should be automatically show 2 months before the end date of the current.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have all the measures such as previous two months sales but all i need is to show the dynamic interactivity between previous and current date slicers. I've tried edit interactions but it seems not to work for my scenario. I'm using two date sliders with between.&lt;BR /&gt;&lt;BR /&gt;Please help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 04:52:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-custom-date-slicer-based-current-selected-periosd/m-p/2562684#M72948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-07T04:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create custom date slicer based current selected periosd</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-custom-date-slicer-based-current-selected-periosd/m-p/2563434#M72990</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , try one of three options &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//previous period month &lt;BR /&gt;Same Date range last period = &lt;BR /&gt;var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1&lt;BR /&gt;var _p_st_date = MINX('Date',DATEADD('Date'[date],-1*_diff,Month))-1&lt;BR /&gt;var _p_end_date = MAXX('Date',DATEADD('Date'[date],-1*_diff,Month))-1&lt;BR /&gt;Return&lt;BR /&gt;CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]&amp;gt;=_p_st_date &amp;amp;&amp;amp; 'Date'[date]&amp;lt;= _p_end_date&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Same Date range last period Month = &lt;BR /&gt;var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1 &lt;BR /&gt;Return&lt;BR /&gt;CALCULATE(sum(Sales[Sales Amount]),dateadd('Date'[date],-1*_diff,Month))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same Date range last period = &lt;BR /&gt;var _diff = datediff(MIN('Date'[date]),max('Date'[date]),Month)+1&lt;BR /&gt;var _p_st_date = Eomonth(MINX('Date','Date'[date], _1* _diff)-1&lt;BR /&gt;var _p_end_date = Eomonth(MAXX('Date','Date'[date], _1* _diff)&lt;BR /&gt;Return&lt;BR /&gt;CALCULATE(sum(Sales[Sales Amount]),all('Date'[date]),'Date'[date]&amp;gt;=_p_st_date &amp;amp;&amp;amp; 'Date'[date]&amp;lt;= _p_end_date&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 09:12:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-custom-date-slicer-based-current-selected-periosd/m-p/2563434#M72990</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-07T09:12:35Z</dc:date>
    </item>
  </channel>
</rss>

