<?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: Comparing partial week to last year partial week when number of days in week are different in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4059540#M161132</link>
    <description>&lt;P&gt;Thanks.&amp;nbsp; It wasn't the exact solution for me, but it helped me get to my solution.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2024 17:23:33 GMT</pubDate>
    <dc:creator>bobbyd</dc:creator>
    <dc:date>2024-07-24T17:23:33Z</dc:date>
    <item>
      <title>Comparing partial week to last year partial week when number of days in week are different</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4051005#M160733</link>
      <description>&lt;P&gt;I'm stuck on how to figure this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a slicer for fiscal week end date and a table that displays for each week end date the week days and then compares to last fiscal year week.&amp;nbsp; Each fiscal week end date is &lt;STRONG&gt;always&lt;/STRONG&gt; a Saturday.&lt;/P&gt;&lt;P&gt;So for week ending 9/2/2023, the days are Friday 9/1/2023 to Saturday 9/2/2023.&amp;nbsp; The last fiscal year week is Thursday 9/1/2022 to Saturday 9/3/2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, my table ends up only showing Friday and Saturday because my slicer selection is week end 9/2/2023, which only contains 2 days.&amp;nbsp; &amp;nbsp;Last year Thursday 9/1/2022 is only included the computed total line.&amp;nbsp; I have the correct calculations to get last fiscal week numbers, but the "Thursday" row, I can't figure out how to get to display.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wanting to basically always show all 7 days on the table, with blanks where appropriate.&amp;nbsp; &amp;nbsp; I've tried a disconnected table for the 7 days in a week, but could not figure out how to get the calculation for total sales to work for each day of the disconnected table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is only an issue when the first week of fiscal year is a partial week or last week of fiscal year is a partial week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need some pointers on how to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 15:21:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4051005#M160733</guid>
      <dc:creator>bobbyd</dc:creator>
      <dc:date>2024-07-19T15:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing partial week to last year partial week when number of days in week are different</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4051042#M160734</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="543637" data-lia-user-login="bobbyd" class="lia-mention lia-mention-user"&gt;bobbyd&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try the following approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;Create a Disconnected Table for the Days of the Week&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DaysOfWeek = 
DATATABLE(
    "Day", STRING,
    {
        {"Sunday"},
        {"Monday"},
        {"Tuesday"},
        {"Wednesday"},
        {"Thursday"},
        {"Friday"},
        {"Saturday"}
    }
)
&lt;/LI-CODE&gt;
&lt;P&gt;2.&amp;nbsp;Create a measure to calculate the total sales for each day&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TotalSalesByDay = 
VAR SelectedEndDate = SELECTEDVALUE('Calendar'[Fiscal Week End Date])
VAR SelectedStartDate = SelectedEndDate - 6
VAR SalesForDay = 
    CALCULATE(
        SUM('Sales'[Amount]),
        FILTER(
            'Calendar',
            'Calendar'[Date] &amp;gt;= SelectedStartDate &amp;amp;&amp;amp;
            'Calendar'[Date] &amp;lt;= SelectedEndDate &amp;amp;&amp;amp;
            'Calendar'[DayName] = SELECTEDVALUE(DaysOfWeek[Day])
        )
    )
RETURN
    SalesForDay
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 15:37:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4051042#M160734</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-07-19T15:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing partial week to last year partial week when number of days in week are different</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4059540#M161132</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; It wasn't the exact solution for me, but it helped me get to my solution.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 17:23:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-partial-week-to-last-year-partial-week-when-number-of/m-p/4059540#M161132</guid>
      <dc:creator>bobbyd</dc:creator>
      <dc:date>2024-07-24T17:23:33Z</dc:date>
    </item>
  </channel>
</rss>

