<?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 EOWEEK in place of EOMONTH for Interval in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3946818#M153335</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inspired from Gustaw Dudeks custom interval chart&amp;nbsp;&lt;BR /&gt;(Goodly video &lt;A href="https://www.youtube.com/watch?v=RaHi6yc02Tc&amp;amp;t=469s" target="_blank" rel="noopener"&gt;(176) Make this Creative &amp;amp; Insightful Line Chart in Power BI &lt;span class="lia-unicode-emoji" title=":chart_increasing:"&gt;📈&lt;/span&gt; - YouTube&lt;/A&gt;)&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a dataset which has only four months of data and would like to use weekly interval instead of monthly.&amp;nbsp;&lt;BR /&gt;The DAX uses EOMONTH function for setting the correct points.&lt;BR /&gt;&lt;BR /&gt;As there is no direct function for EOWEEK, what alternatives could there be to convert the below DAX to weekly?&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Monthly Interval Points =
var vCurrentMonth = EOMONTH(MAX(DimIntervalCalendar[Date]), 0)

var vInterval = [Interval Range]

var vIntervalLenght = DATESBETWEEN(DimIntervalCalendar[Date], EOMONTH(vCurrentMonth, - vInterval) +1, vCurrentMonth)

var vIntegratedCalendars = CALCULATETABLE(DimCalendar, TREATAS(vIntervalLenght, DimCalendar[Date]))

var vTop = DATESBETWEEN(DimCalendar[Date], EOMONTH(vCurrentMonth, - vInterval) + 1, EOMONTH(EOMONTH(vCurrentMonth, - vInterval) + 1, 0))

var vBottom = DATESBETWEEN(DimCalendar[Date], EOMONTH(vCurrentMonth, - 1) + 1, vCurrentMonth)

var vIntegrate = UNION(vTop, vBottom)

var vMaxExpression = CALCULATE(MAXX(ALLSELECTED(DimCalendar[MMM]), [Expression Stage]), vIntegratedCalendars)

var vTotalExpression = CALCULATE([Expression Stage], vIntegrate, KEEPFILTERS(DimCalendar))

return
IF(vTotalExpression, vMaxExpression * 1.3)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2024 10:06:38 GMT</pubDate>
    <dc:creator>Oodi</dc:creator>
    <dc:date>2024-05-24T10:06:38Z</dc:date>
    <item>
      <title>EOWEEK in place of EOMONTH for Interval</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3946818#M153335</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inspired from Gustaw Dudeks custom interval chart&amp;nbsp;&lt;BR /&gt;(Goodly video &lt;A href="https://www.youtube.com/watch?v=RaHi6yc02Tc&amp;amp;t=469s" target="_blank" rel="noopener"&gt;(176) Make this Creative &amp;amp; Insightful Line Chart in Power BI &lt;span class="lia-unicode-emoji" title=":chart_increasing:"&gt;📈&lt;/span&gt; - YouTube&lt;/A&gt;)&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I have a dataset which has only four months of data and would like to use weekly interval instead of monthly.&amp;nbsp;&lt;BR /&gt;The DAX uses EOMONTH function for setting the correct points.&lt;BR /&gt;&lt;BR /&gt;As there is no direct function for EOWEEK, what alternatives could there be to convert the below DAX to weekly?&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Monthly Interval Points =
var vCurrentMonth = EOMONTH(MAX(DimIntervalCalendar[Date]), 0)

var vInterval = [Interval Range]

var vIntervalLenght = DATESBETWEEN(DimIntervalCalendar[Date], EOMONTH(vCurrentMonth, - vInterval) +1, vCurrentMonth)

var vIntegratedCalendars = CALCULATETABLE(DimCalendar, TREATAS(vIntervalLenght, DimCalendar[Date]))

var vTop = DATESBETWEEN(DimCalendar[Date], EOMONTH(vCurrentMonth, - vInterval) + 1, EOMONTH(EOMONTH(vCurrentMonth, - vInterval) + 1, 0))

var vBottom = DATESBETWEEN(DimCalendar[Date], EOMONTH(vCurrentMonth, - 1) + 1, vCurrentMonth)

var vIntegrate = UNION(vTop, vBottom)

var vMaxExpression = CALCULATE(MAXX(ALLSELECTED(DimCalendar[MMM]), [Expression Stage]), vIntegratedCalendars)

var vTotalExpression = CALCULATE([Expression Stage], vIntegrate, KEEPFILTERS(DimCalendar))

return
IF(vTotalExpression, vMaxExpression * 1.3)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 10:06:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3946818#M153335</guid>
      <dc:creator>Oodi</dc:creator>
      <dc:date>2024-05-24T10:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: EOWEEK in place of EOMONTH for Interval</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3946891#M153337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="462806" data-lia-user-login="Oodi" class="lia-mention lia-mention-user"&gt;Oodi&lt;/a&gt;&amp;nbsp;try to use WEEKNUM function, check &lt;A href="https://learn.microsoft.com/en-us/dax/weeknum-function-dax?WT.mc_id=DP-MVP-4025372" target="_blank"&gt;link&lt;/A&gt; for example&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 10:09:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3946891#M153337</guid>
      <dc:creator>some_bih</dc:creator>
      <dc:date>2024-05-24T10:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: EOWEEK in place of EOMONTH for Interval</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3949328#M153409</link>
      <description>&lt;P&gt;Weeks and months are incompatible. Make sure your users understand the difference.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2024 12:36:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3949328#M153409</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-05-25T12:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: EOWEEK in place of EOMONTH for Interval</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3950114#M153426</link>
      <description>&lt;P&gt;Was able to convert the Line chart to use weeks instead of months with the following DAX:&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Interval Weekly Points = 

VAR _MaxWeek =
MAX(DimIntervalCalendar[EndofWeek])

VAR _MaxMonth =
EOMONTH(MAX(DimIntervalCalendar[Date]), 0)

VAR _Interval = 
[Interval Range]

VAR _Calendar = 
DATESBETWEEN(DimIntervalCalendar[Date], _MaxWeek - (_Interval * 7) + 1, _MaxWeek)

VAR _JoinedCalendar =
CALCULATETABLE(DimCalendar, TREATAS(_Calendar, DimCalendar[Date]))

VAR _Top =
DATESBETWEEN(DimCalendar[Date], _MaxWeek - (_Interval * 7) + 1, _MaxWeek -(_Interval * 7) + 7)

VAR _Bottom =
DATESBETWEEN(DimCalendar[Date], _MaxWeek - (1 * 7) + 1, _MaxWeek)

VAR _Joined =
UNION(_Top, _Bottom)

VAR _MaxExpression =
CALCULATE(MAXX(ALLSELECTED(DimCalendar[WeekofYear]), [Expression]), _JoinedCalendar)

VAR _TotalExpression =
CALCULATE([Expression], _Joined, KEEPFILTERS(DimCalendar))

RETURN 
IF(_TotalExpression, _MaxExpression * 1.3)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interval can stay the same:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Interval Range = 
GENERATESERIES(1 , 20, 1)&lt;/LI-CODE&gt;&lt;P&gt;but month-year slicer has to be replaced with week.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DimIntervalCalendar = 
var vCal = CALENDAR(MIN(Railway[DateofPurchase]), MAX(Railway[DateofJourney]))
var vTable =
ADDCOLUMNS(
    vCal,
    "Sort", YEAR([Date]) &amp;amp; UNICHAR(MONTH([Date]) + 64),
    "Year Month", FORMAT([Date], "mmm-yy"),
    "Year", FORMAT([Date], "yyyy"),
    "Month", FORMAT([Date], "mmm"),
    "Month Week", FORMAT([Date], "ww-mmm"),
    "Week", FORMAT([Date], "ww"))

    return
     vTable&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2024 14:33:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/EOWEEK-in-place-of-EOMONTH-for-Interval/m-p/3950114#M153426</guid>
      <dc:creator>Oodi</dc:creator>
      <dc:date>2024-05-26T14:33:45Z</dc:date>
    </item>
  </channel>
</rss>

