<?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 4 / 13/ 52 Week Rolling Averages in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987669#M100366</link>
    <description>&lt;P&gt;Hi I am trying to create a number of cards that contain the following rolling averages. 4 week, 13 week and 52 week. I don't know what measure to create in order to achieve these reults. I can try and send the sample file but not sure best way to attach it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to sample file attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AiZ1-kl9lagZgt4olcKdIRRuzIxiEg?e=bbrnvL" target="_blank"&gt;https://1drv.ms/u/s!AiZ1-kl9lagZgt4olcKdIRRuzIxiEg?e=bbrnvL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Calendar Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Visual I am trying to achieve for weekly averages&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Weekly Sum Matrix already built&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 24 Dec 2022 17:55:17 GMT</pubDate>
    <dc:creator>Quest77</dc:creator>
    <dc:date>2022-12-24T17:55:17Z</dc:date>
    <item>
      <title>4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987669#M100366</link>
      <description>&lt;P&gt;Hi I am trying to create a number of cards that contain the following rolling averages. 4 week, 13 week and 52 week. I don't know what measure to create in order to achieve these reults. I can try and send the sample file but not sure best way to attach it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to sample file attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AiZ1-kl9lagZgt4olcKdIRRuzIxiEg?e=bbrnvL" target="_blank"&gt;https://1drv.ms/u/s!AiZ1-kl9lagZgt4olcKdIRRuzIxiEg?e=bbrnvL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Calendar Table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Visual I am trying to achieve for weekly averages&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Weekly Sum Matrix already built&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 17:55:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987669#M100366</guid>
      <dc:creator>Quest77</dc:creator>
      <dc:date>2022-12-24T17:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987670#M100367</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490946" data-lia-user-login="Quest77" class="lia-mention lia-mention-user"&gt;Quest77&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to share the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like &lt;A href="http://www.tinyupload.com" target="_self"&gt;tinyupload.com&lt;/A&gt; (no sign-up required).&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;&lt;BR /&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 17:35:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987670#M100367</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T17:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987678#M100368</link>
      <description>&lt;P&gt;I attached the sample file via link in my original post&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 17:55:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987678#M100368</guid>
      <dc:creator>Quest77</dc:creator>
      <dc:date>2022-12-24T17:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987745#M100377</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490946" data-lia-user-login="Quest77" class="lia-mention lia-mention-user"&gt;Quest77&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First create a calculated column with the number of weeks offset from the current week for each date in the Calendar table. This will simplify the measures: &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CurrentWeekOffset = 
VAR currentWeekStart_ =
    DATEVALUE (
        LOOKUPVALUE ( 'Calendar'[Week Start Date], 'Calendar'[Date], TODAY () )
    )
VAR currentRowWeekStart_ = 'Calendar'[Week Start Date]
RETURN
    DATEDIFF ( currentWeekStart_, currentRowWeekStart_, WEEK )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then build the measure for the 4 week rolling average. Note it is going back from the current date&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;4 Week Rolling Average V2 = 
VAR numWeeks_ = 4
VAR weeksT_ =
    CALCULATETABLE (
        DISTINCT ( 'Calendar'[CurrentWeekOffset] ),
        'Calendar'[CurrentWeekOffset] &amp;gt;= - numWeeks_,
        'Calendar'[CurrentWeekOffset] &amp;lt;= 0,
        ALL ( 'Calendar' )
    )
RETURN
    CALCULATE (
        AVERAGEX ( weeksT_, CALCULATE ( SUM ( SETTLEMENT_STATEMENTS[Sales] ) ) ),
        ALL ( 'Calendar' )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 20:10:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987745#M100377</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T20:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987746#M100378</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490946" data-lia-user-login="Quest77" class="lia-mention lia-mention-user"&gt;Quest77&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exactly same pattern for the 13 and 52 week. Only the variable at the top changes&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;13 Week Rolling Average = 
VAR numWeeks_ = 13
VAR weeksT_ =
    CALCULATETABLE (
        DISTINCT ( 'Calendar'[CurrentWeekOffset] ),
        'Calendar'[CurrentWeekOffset] &amp;gt;= - numWeeks_,
        'Calendar'[CurrentWeekOffset] &amp;lt;= 0,
        ALL ( 'Calendar' )
    )
RETURN
    CALCULATE (
        AVERAGEX ( weeksT_, CALCULATE ( SUM ( SETTLEMENT_STATEMENTS[Sales] ) ) ),
        ALL ( 'Calendar' )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;52 Week Rolling Average = 
VAR numWeeks_ = 52
VAR weeksT_ =
    CALCULATETABLE (
        DISTINCT ( 'Calendar'[CurrentWeekOffset] ),
        'Calendar'[CurrentWeekOffset] &amp;gt;= - numWeeks_,
        'Calendar'[CurrentWeekOffset] &amp;lt;= 0,
        ALL ( 'Calendar' )
    )
RETURN
    CALCULATE (
        AVERAGEX ( weeksT_, CALCULATE ( SUM ( SETTLEMENT_STATEMENTS[Sales] ) ) ),
        ALL ( 'Calendar' )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 20:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987746#M100378</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T20:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987749#M100379</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490946" data-lia-user-login="Quest77" class="lia-mention lia-mention-user"&gt;Quest77&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See it all at work in the attached file (&lt;EM&gt;Overview&lt;/EM&gt; page)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 20:14:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/2987749#M100379</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2022-12-24T20:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/3797049#M148393</link>
      <description>&lt;P&gt;When i used the same function to create measure current week offset, it got failed due to an error that a single value cannot be determined. Anyway i can connect with you about this problem? Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 13:22:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/3797049#M148393</guid>
      <dc:creator>stellasun820</dc:creator>
      <dc:date>2024-03-28T13:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: 4 / 13/ 52 Week Rolling Averages</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/3797058#M148394</link>
      <description>&lt;P&gt;If my date table already has week start date, do we still need calendarweekoffset? When i tried to create the first measure, it didn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 13:28:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/4-13-52-Week-Rolling-Averages/m-p/3797058#M148394</guid>
      <dc:creator>stellasun820</dc:creator>
      <dc:date>2024-03-28T13:28:09Z</dc:date>
    </item>
  </channel>
</rss>

