<?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: Relative Date Based on Slice Selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/848995#M6629</link>
    <description>&lt;P&gt;I solved my problem with the following measure with some adjustment to deal with year/month. But the idea is to use an agregate function considering all dates from calendar that is inside a range (GENERATESERIES).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_TotalProduct = 
CALCULATE(
    SUM(Data[product]); 
    FILTER(
        ALL(Calendar); 
        Calendar[Year] IN GENERATESERIES(SELECTEDVALUE(Calendar[Year])-3; SELECTEDVALUE(Calendar[Year]);1)
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Nov 2019 13:52:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-18T13:52:58Z</dc:date>
    <item>
      <title>Relative Date Based on Slice Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/839077#M6317</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My model has two table, one for the calendar and other for data. I have a date slice and a matrix with month/year columns.&lt;/P&gt;&lt;P&gt;I would like to show the last 3 months as column based on slice selected value.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Model&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Report&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 19:58:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/839077#M6317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T19:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Date Based on Slice Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/839116#M6319</link>
      <description>&lt;P&gt;Try using relative date filter&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @ &lt;/STRONG&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;My Recent Blog - &lt;A href="https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 21:20:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/839116#M6319</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2019-11-06T21:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Date Based on Slice Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/839854#M6341</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;Tks for the answer.&lt;/P&gt;&lt;P&gt;Your example use "today" as the start date for the relative dates. But in my case, I use a slice that user can select the base date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 12:50:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/839854#M6341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-07T12:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Relative Date Based on Slice Selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/848995#M6629</link>
      <description>&lt;P&gt;I solved my problem with the following measure with some adjustment to deal with year/month. But the idea is to use an agregate function considering all dates from calendar that is inside a range (GENERATESERIES).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;_TotalProduct = 
CALCULATE(
    SUM(Data[product]); 
    FILTER(
        ALL(Calendar); 
        Calendar[Year] IN GENERATESERIES(SELECTEDVALUE(Calendar[Year])-3; SELECTEDVALUE(Calendar[Year]);1)
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 13:52:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Relative-Date-Based-on-Slice-Selected/m-p/848995#M6629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-18T13:52:58Z</dc:date>
    </item>
  </channel>
</rss>

