<?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 weeks calculation in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391696#M178564</link>
    <description>&lt;P&gt;I posted a better/more complete version here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Apr 2018 22:02:46 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2018-04-07T22:02:46Z</dc:date>
    <item>
      <title>Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391672#M178551</link>
      <description>&lt;P&gt;I am tring to calculate rolling 4 weeks based on selected date from slicer. The slicer has only week ending date. So If I select "11/19/2017), I would&amp;nbsp; I ideally want to see sales for "11/12/2017", 11/05/2017, 10/29/2017, 10/22/2017.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 19:46:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391672#M178551</guid>
      <dc:creator>sgsukumaran</dc:creator>
      <dc:date>2018-04-07T19:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391673#M178552</link>
      <description>&lt;P&gt;Take a look at my Week Starting/Ending measures in the Quick Measures Gallery. Should get you what you need to filter your data correctly. If not, I can make the modifications to do this most likely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Week-Starting/m-p/391487" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Week-Starting/m-p/391487&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data would help me come up with a specific solution. Please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 20:05:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391673#M178552</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-07T20:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391675#M178553</link>
      <description>&lt;P&gt;This is exactly what i am trying to create.&amp;nbsp; So if Select&amp;nbsp; 3/10 /2018 from my slicer i would wanted the rolling measures to display all weeks before it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 20:16:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391675#M178553</guid>
      <dc:creator>sgsukumaran</dc:creator>
      <dc:date>2018-04-07T20:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391688#M178561</link>
      <description>&lt;P&gt;OK, you need slight variations of my Week Start and Week End measures plus the ones contained in the attached file and listed below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rolling Week Start&lt;/P&gt;&lt;PRE&gt;Rolling Week Start = 
VAR DateFrom = MAX([Date])
VAR WeeksBack = 4
VAR tmpCalendar = CALCULATETABLE('Calendar',ALL('Calendar'))
VAR tmpCalendar1 = ADDCOLUMNS(tmpCalendar,"WeekNum",WEEKNUM([Date]),"WeekEnding",[mWeekEnding],"WeekStarting",[mWeekStarting])
VAR LookupDate = DateFrom-7*WeeksBack
VAR tmpCalendar2 = FILTER(tmpCalendar1,[Date]=LookupDate)
VAR retValue = MAXX(tmpCalendar2,[WeekStarting])
RETURN IF(ISBLANK(retValue),MINX(tmpCalendar1,[WeekStarting]),retValue)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rolling Week End&lt;/P&gt;&lt;PRE&gt;Rolling Week End = 
VAR DateFrom = MAX([Date])
VAR WeeksBack = 0
VAR tmpCalendar = CALCULATETABLE('Calendar',ALL('Calendar'))
VAR tmpCalendar1 = ADDCOLUMNS(tmpCalendar,"WeekNum",WEEKNUM([Date]),"WeekEnding",[mWeekEnding],"WeekStarting",[mWeekStarting])
VAR LookupDate = DateFrom-7*WeeksBack
VAR tmpCalendar2 = FILTER(tmpCalendar1,[Date]=LookupDate)
RETURN MAXX(tmpCalendar2,[WeekEnding])&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Apr 2018 21:15:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391688#M178561</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-07T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391696#M178564</link>
      <description>&lt;P&gt;I posted a better/more complete version here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 22:02:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391696#M178564</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-07T22:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391700#M178565</link>
      <description>&lt;P&gt;Thanks. Where would I add the sum of sales in this mix?&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 23:22:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391700#M178565</guid>
      <dc:creator>sgsukumaran</dc:creator>
      <dc:date>2018-04-07T23:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391709#M178572</link>
      <description>&lt;P&gt;That would be the Measure formula that I posted in the Quick Measure:&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, something along the lines of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Measure = 
VAR rollweekstart = [Rolling Week Start]
VAR rollweekend = [Rolling Week End]
VAR tmpTable = ALL('Calendar')
VAR tmpTable1 = FILTER(tmpTable,[Date]&amp;gt;=rollweekstart&amp;amp;&amp;amp;[Date]&amp;lt;=rollweekend)
RETURN SUMX(tmpTable1,[Value])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you could give me a sense of your source data, that would greatly help. See this post here: Please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&amp;nbsp;" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 02:06:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391709#M178572</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-08T02:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391716#M178578</link>
      <description>&lt;P&gt;Thanks. This is a direct query from tabular model. so I am limited with options.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 02:47:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391716#M178578</guid>
      <dc:creator>sgsukumaran</dc:creator>
      <dc:date>2018-04-08T02:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391827#M178635</link>
      <description>&lt;P&gt;So, is it as simple as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WeekEnding, Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a single table or ?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 14:55:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391827#M178635</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-08T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391855#M178650</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes All i would need is Sum(sales) for rolling 4 weeks. The Strtdate is from Fiscalcalendar and Sales is from Fact joined by calendar date.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 17:51:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391855#M178650</guid>
      <dc:creator>sgsukumaran</dc:creator>
      <dc:date>2018-04-08T17:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391861#M178653</link>
      <description>&lt;P&gt;OK, I really need sample data so that I can get this right. What does your fiscal calendar table look like?&amp;nbsp;Is it just a standard calendar table like that generated by CALENDAR() function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then I assume that your sales table would have something in it like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sales table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date,Sales&lt;/P&gt;&lt;P&gt;4/1/2018,1000&lt;/P&gt;&lt;P&gt;4/1/2018,500&lt;/P&gt;&lt;P&gt;4/2/2018,300&lt;/P&gt;&lt;P&gt;4/2/2018,100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you have a relationship like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calendar 1-&amp;gt;*Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this all correct?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 18:30:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391861#M178653</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-08T18:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391886#M178664</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Yes. Thats exactly it.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 20:11:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391886#M178664</guid>
      <dc:creator>sgsukumaran</dc:creator>
      <dc:date>2018-04-08T20:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling weeks calculation</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391889#M178666</link>
      <description>&lt;P&gt;OK, see attached PBIX Page 2. I added a Sales table and created a "Rolling Sales" measure. And graphed it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Rolling Sales = 
VAR rollweekstart = [Rolling Week Start]
VAR rollweekend = [Rolling Week End]
VAR tmpTable = ALL('Sales')
VAR tmpTable1 = FILTER(tmpTable,[Date]&amp;gt;=rollweekstart&amp;amp;&amp;amp;[Date]&amp;lt;=rollweekend)
RETURN SUMX(tmpTable1,[Value])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Apr 2018 20:24:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Rolling-weeks-calculation/m-p/391889#M178666</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2018-04-08T20:24:24Z</dc:date>
    </item>
  </channel>
</rss>

