<?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 Display last X weeks based on single week slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2020906#M45018</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a YearWeek field in my Calendar table which selects a week's worth of data as seen below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to know if it's possible to show the last 12 weeks (Daily data) based off the YearWeek selection. It basically needs to get the last 'Calendar'[Date] for the selected week and get me the 84 days (7 days * 12 weeks) before that time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what my Calendar looks like with the YearWeek custom column:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for taking the time.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Aug 2021 09:50:57 GMT</pubDate>
    <dc:creator>TomBLG</dc:creator>
    <dc:date>2021-08-17T09:50:57Z</dc:date>
    <item>
      <title>Display last X weeks based on single week slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2020906#M45018</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a YearWeek field in my Calendar table which selects a week's worth of data as seen below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to know if it's possible to show the last 12 weeks (Daily data) based off the YearWeek selection. It basically needs to get the last 'Calendar'[Date] for the selected week and get me the 84 days (7 days * 12 weeks) before that time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what my Calendar looks like with the YearWeek custom column:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for taking the time.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 09:50:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2020906#M45018</guid>
      <dc:creator>TomBLG</dc:creator>
      <dc:date>2021-08-17T09:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Display last X weeks based on single week slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2020987#M45023</link>
      <description>&lt;P&gt;I forgot to include an important part. Above the graph there's a table visualisation. The graph will only populate when an item in the table has been selected:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure I'm using for the graph values is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Metric Selection =&lt;BR /&gt;IF (&lt;BR /&gt;ISFILTERED('Table2'[MetricName]),&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;VALUES('Table2'[MetricName]) = "Name1", SUM('Daily'[Metric1]),&lt;BR /&gt;VALUES('Table2'[MetricName]) = "Name2", SUM('Daily'[Metric2]),&lt;BR /&gt;VALUES('Table2'[MetricName]) = "Name3", SUM('Daily'[Metric3]),&lt;BR /&gt;BLANK ()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is as close as I've gotten to getting a 12Week version:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;12Week Metric Selection =&lt;BR /&gt;IF (&lt;BR /&gt;ISFILTERED('Table2'[MetricName]),&lt;BR /&gt;SWITCH(&lt;BR /&gt;TRUE(),&lt;BR /&gt;VALUES('Table2'[MetricName]) = "Name1", CALCULATE(SUM('Daily'[Metric1]), FILTER (ALLSELECTED('Calendar'),'Calendar'[Date]&amp;gt;= MAX ('Calendar'[Date]) - 84 &amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt;= MAX ('Calendar'[Date]))),&lt;BR /&gt;VALUES('Table2'[MetricName]) = "Name2", CALCULATE(SUM('Daily'[Metric2]), FILTER (ALLSELECTED('Calendar'),'Calendar'[Date]&amp;gt;= MAX ('Calendar'[Date]) - 84 &amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt;= MAX ('Calendar'[Date]))),&lt;BR /&gt;VALUES('Table2'[MetricName]) = "Name3", CALCULATE(SUM('Daily'[Metric3]), FILTER (ALLSELECTED('Calendar'),'Calendar'[Date]&amp;gt;= MAX ('Calendar'[Date]) - 84 &amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt;= MAX ('Calendar'[Date]))),&lt;BR /&gt;BLANK ()&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 10:37:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2020987#M45023</guid>
      <dc:creator>TomBLG</dc:creator>
      <dc:date>2021-08-17T10:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Display last X weeks based on single week slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2021206#M45041</link>
      <description>&lt;P&gt;After some trial and error, I managed to get what I wanted by following a Youtube video titled "Show last 6 months based on user single slicer selection" from SQLBI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;12Weeks = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR ReferenceDate = MAX ( 'Calendar'[Date] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR PreviousDates =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATESINPERIOD (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Previous Date'[Date],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ReferenceDate,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-84,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR Result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;SUM('Daily'[Metric1]),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;REMOVEFILTERS( 'Calendar' ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KEEPFILTERS( PreviousDates ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USERELATIONSHIP( 'Calendar'[Date], 'Previous Date'[Date] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&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;Result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I still need to change the &lt;FONT color="#FF0000"&gt;red section&lt;/FONT&gt; and integrate my "Metric Selection" measure somehow but things are well underway now.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I appreciate the time anyone took looking into this, thank you.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:45:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/2021206#M45041</guid>
      <dc:creator>TomBLG</dc:creator>
      <dc:date>2021-08-17T12:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Display last X weeks based on single week slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/3415055#M129181</link>
      <description>Thanks! You are a life saver. That video is so easy to watch and explains step by step logic needed.</description>
      <pubDate>Tue, 05 Sep 2023 07:24:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-last-X-weeks-based-on-single-week-slicer/m-p/3415055#M129181</guid>
      <dc:creator>Xy_pbi</dc:creator>
      <dc:date>2023-09-05T07:24:23Z</dc:date>
    </item>
  </channel>
</rss>

