<?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 Date Identifiers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927396#M186929</link>
    <description>&lt;P&gt;&lt;STRONG&gt;1) Create a WeekStart column in your Date table (Monday-start example):&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;WeekStart =
'Date'[Date] - WEEKDAY('Date'[Date], 2) + 1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2) Then create a RollingWeekIndex (1–5) measure (or calculated column if you truly need it stored):&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RollingWeekIndex =
VAR CurrentWeekStart =
    MAX ( 'Date'[WeekStart] )
VAR LatestWeekStart =
    CALCULATE ( MAX ( 'Date'[WeekStart] ), ALL ( 'Date' ) )
VAR DiffWeeks =
    DATEDIFF ( CurrentWeekStart, LatestWeekStart, WEEK )
RETURN
IF ( DiffWeeks &amp;gt;= 0 &amp;amp;&amp;amp; DiffWeeks &amp;lt;= 4, 5 - DiffWeeks )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jan 2026 20:45:53 GMT</pubDate>
    <dc:creator>cengizhanarslan</dc:creator>
    <dc:date>2026-01-26T20:45:53Z</dc:date>
    <item>
      <title>Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927348#M186927</link>
      <description>&lt;P&gt;I support a team monitoring weekly captured data from a 5 week window. Each row of my set has a specific date - thousands of rows of data fitting into 5 weeks, and my report needs to dynamically compare each week's data with the others.&amp;nbsp;I'm working to prep DAX to assign number 1-5 to each of the weeks as the project rolls on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So currently: Dec 22 = 1, Dec 29 = 2, Jan 5 =3, Jan 12 = 4, Jan 19 = 5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next week: Dec 29 = 1, Jan 5 = 2, Jan 12 = 3, Jan 19 = 4, Jan 26 = 5 and so on..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First time in the forums so please let me know if I need to provide additional context.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:58:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927348#M186927</guid>
      <dc:creator>zedsdead</dc:creator>
      <dc:date>2026-01-26T18:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927376#M186928</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1521757" data-lia-user-login="zedsdead" class="lia-mention lia-mention-user"&gt;zedsdead&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;P&gt;I am not entirely certain, but for this type of dynamic comparison between weeks, what usually works very well is to create a “Week Index” logic that adjusts itself automatically as the calendar moves forward.&lt;/P&gt;
&lt;P&gt;From your description, your requirements are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;You always work with a 5‑week rolling window.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Each of those 5 weeks must be assigned a label from 1 to 5, where:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;1 = oldest week in the current 5‑week window&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;5 = most recent week in the current 5‑week window&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;When a new week is added, every existing week “shifts” its index.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;That´s it ?&lt;BR /&gt;&lt;BR /&gt;My suggestion is to create a measure that calculates, for each week, which index (1–5) it should have based on the most recent week present in the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;Ideally, you should have a Date/Calendar table and, within it, a column that represents the week. Typical options include:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;A “week ending” date (e.g. every Friday or Sunday),&lt;/LI&gt;
&lt;LI&gt;Or a week number plus year (e.g. ISO week).&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV&gt;For the sake of the example, let us assume you have:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;!--ScriptorStartFragment--&gt;'Data'[WeekEnding]&lt;!--ScriptorEndFragment--&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;This is a date representing the end of each week (for example, every Friday).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;WeekIndex measure:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;WeekIndex :=&lt;BR /&gt;VAR LatestWeek =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;MAX('Data'[WeekEnding]),&lt;BR /&gt;ALL('Data')&lt;BR /&gt;)&lt;BR /&gt;VAR ThisWeek =&lt;BR /&gt;SELECTEDVALUE('Data'[WeekEnding])&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(ThisWeek),&lt;BR /&gt;5 - DATEDIFF(ThisWeek, LatestWeek, WEEK)&lt;BR /&gt;)&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Jan 2026 20:00:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927376#M186928</guid>
      <dc:creator>Zanqueta</dc:creator>
      <dc:date>2026-01-26T20:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927396#M186929</link>
      <description>&lt;P&gt;&lt;STRONG&gt;1) Create a WeekStart column in your Date table (Monday-start example):&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;WeekStart =
'Date'[Date] - WEEKDAY('Date'[Date], 2) + 1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2) Then create a RollingWeekIndex (1–5) measure (or calculated column if you truly need it stored):&lt;/STRONG&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RollingWeekIndex =
VAR CurrentWeekStart =
    MAX ( 'Date'[WeekStart] )
VAR LatestWeekStart =
    CALCULATE ( MAX ( 'Date'[WeekStart] ), ALL ( 'Date' ) )
VAR DiffWeeks =
    DATEDIFF ( CurrentWeekStart, LatestWeekStart, WEEK )
RETURN
IF ( DiffWeeks &amp;gt;= 0 &amp;amp;&amp;amp; DiffWeeks &amp;lt;= 4, 5 - DiffWeeks )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 20:45:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927396#M186929</guid>
      <dc:creator>cengizhanarslan</dc:creator>
      <dc:date>2026-01-26T20:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927946#M186957</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1521757" data-lia-user-login="zedsdead" class="lia-mention lia-mention-user"&gt;zedsdead&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if i fully get you, try to write a calculated column like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column = 
VAR _DateCurrent =  TODAY()
// VAR _DateCurrent = DATE(2026, 2, 9)
VAR _MondayCurrent = _DateCurrent - WEEKDAY(_DateCurrent, 3)
VAR _WeekShift = DATEDIFF(DATE(2025,12,22), TODAY(), WEEK)
VAR _result = _WeekShift - DATEDIFF([date], _MondayCurrent, WEEK) +1
RETURN _result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it works like below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you may comment line 2 and uncomment line 3 to try future dates, like next week:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2026 08:03:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4927946#M186957</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2026-01-27T08:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4966779#M187027</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1521757" data-lia-user-login="zedsdead" class="lia-mention lia-mention-user"&gt;zedsdead&lt;/a&gt;,&lt;BR /&gt;Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1292787" data-lia-user-login="cengizhanarslan" class="lia-mention lia-mention-user"&gt;cengizhanarslan&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="861055" data-lia-user-login="Zanqueta" class="lia-mention lia-mention-user"&gt;Zanqueta&lt;/a&gt;&amp;nbsp;for sharing valuable insights.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please confirm if your query has been resolved by the provided solutions? This would be helpful for other members who may encounter similar issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for being part of the Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 10:44:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4966779#M187027</guid>
      <dc:creator>v-ssriganesh</dc:creator>
      <dc:date>2026-01-30T10:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4969173#M187030</link>
      <description>&lt;P&gt;thank you team for all of the responses! I'm still working through the solution and will mark as resolved asap.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 13:12:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4969173#M187030</guid>
      <dc:creator>zedsdead</dc:creator>
      <dc:date>2026-01-30T13:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling Date Identifiers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4987696#M187046</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1521757" data-lia-user-login="zedsdead" class="lia-mention lia-mention-user"&gt;zedsdead&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope everything’s going great with you. Just checking in has the issue been resolved or are you still running into problems? Sharing an update can really help others facing the same thing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2026 06:44:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rolling-Date-Identifiers/m-p/4987696#M187046</guid>
      <dc:creator>v-ssriganesh</dc:creator>
      <dc:date>2026-02-02T06:44:19Z</dc:date>
    </item>
  </channel>
</rss>

