<?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: Rolling average of a measure by day of week in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2563996#M73015</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;, thanks for helping with this. Unfortunately this is still giving the average over 30 successive days. I'm trying to get the average for the last 4 Sundays, Mondays, etc.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 13:06:23 GMT</pubDate>
    <dc:creator>Oceanbagel</dc:creator>
    <dc:date>2022-06-07T13:06:23Z</dc:date>
    <item>
      <title>Rolling average of a measure by day of week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2562180#M72920</link>
      <description>&lt;P&gt;I have a measure that calculates the percent of table records meeting a threshold and I need to get the average of this measure for the last 4 occurrences of each weekday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MEASURE = CALCULATE(COUNTROWS(ReportTable),ReportTable[Seconds] &amp;lt; 16) / COUNTROWS(ReportTable)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a rolling average of this measure that calculates the last 30 days:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;30 DAY AVG =&lt;/EM&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR DateFilter = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;EM&gt;DATESINPERIOD(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;DateTable[Date],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;MAX(DateTable[Date]),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;-30,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;EM&gt;DAY&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR RollingSum = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;CALCULATE(SUMX(ReportTable,[Measure])/COUNTROWS(ReportTable),DateFilter)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RollingSum&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My date table has day of week but it can't be used in DATESINPERIOD. I've tried a lot of different things but I'm stuck.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Jun 2022 22:15:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2562180#M72920</guid>
      <dc:creator>Oceanbagel</dc:creator>
      <dc:date>2022-06-06T22:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average of a measure by day of week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2562623#M72943</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398026" data-lia-user-login="Oceanbagel" class="lia-mention lia-mention-user"&gt;Oceanbagel&lt;/a&gt; , You need to have measure like examples&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 30 = calculate(AverageX(Values('Date'[Date]),[Measure]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 30 = calculate(AverageX(Values('Date'[Week Day]),[Measure]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 03:36:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2562623#M72943</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-07T03:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average of a measure by day of week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2563996#M73015</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;, thanks for helping with this. Unfortunately this is still giving the average over 30 successive days. I'm trying to get the average for the last 4 Sundays, Mondays, etc.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 13:06:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2563996#M73015</guid>
      <dc:creator>Oceanbagel</dc:creator>
      <dc:date>2022-06-07T13:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling average of a measure by day of week</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2564172#M73020</link>
      <description>&lt;P&gt;I was able to figure it out. Added a values filter to the calculate portion of the measure. It seems so obvious now.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Last 4 DoW =&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR DateFilter = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;DATESINPERIOD(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;DateTable[Date],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;MAX(DateTable[Date]),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;-28,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;DAY&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;EM&gt;VAR RollingSum = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;CALCULATE(SUMX(ReportTable,[Measure])/COUNTROWS(ReportTable),DateFilter,&lt;STRONG&gt;VALUES(DateTable[DayofWeek])&lt;/STRONG&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RollingSum&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Jun 2022 14:01:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-average-of-a-measure-by-day-of-week/m-p/2564172#M73020</guid>
      <dc:creator>Oceanbagel</dc:creator>
      <dc:date>2022-06-07T14:01:34Z</dc:date>
    </item>
  </channel>
</rss>

