<?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: Data as at same date in previous years in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4792070#M183419</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640707" data-lia-user-login="greenskmachine" class="lia-mention lia-mention-user"&gt;greenskmachine&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has your issue been resolved?&lt;BR /&gt;If the response provided by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="695049" data-lia-user-login="MohamedFowzan1" class="lia-mention lia-mention-user"&gt;MohamedFowzan1&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;&amp;nbsp; addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your understanding!&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 09 Aug 2025 17:22:24 GMT</pubDate>
    <dc:creator>v-sgandrathi</dc:creator>
    <dc:date>2025-08-09T17:22:24Z</dc:date>
    <item>
      <title>Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4789348#M183334</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a situation where I want to report data for each fiscal year (or other calendar dimension), up to the latest date where data is available, and using that date (day and month) for reporting data in previous years.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For example, my data is up 2nd August. Reporting by fiscal year I'd want this to report:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;FY2025 - 1 July 2025 to 2 August 2025&lt;BR /&gt;FY2024 - 1 July 2024 to 2 August 2024&lt;BR /&gt;FY2023 - 1 July 2024 to 2 August 2023&lt;BR /&gt;etc&lt;BR /&gt;&lt;BR /&gt;I have the below measure that does give me the data in the format I need, by finding the max data date, and using that to find the fiscal day of year to filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;maxDate&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; =&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Weight&lt;/SPAN&gt;&lt;SPAN&gt;[ProcessedDate]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;dayPeriod&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE&lt;/SPAN&gt;&lt;SPAN&gt;[Fiscal Day of Year]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;maxDate&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Weight&lt;/SPAN&gt;&lt;SPAN&gt;[Weight]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;DIM_DATE&lt;/SPAN&gt;&lt;SPAN&gt;[Fiscal Day of Year]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;dayPeriod&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;However I'm concerned doing this will skip over leap year days. What would you suggest? Thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Aug 2025 22:27:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4789348#M183334</guid>
      <dc:creator>greenskmachine</dc:creator>
      <dc:date>2025-08-06T22:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4789827#M183345</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;do not worry of leap years, time intelligence will handle that smoothly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To go to last year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE ( [measure], DATEADD ( Calendar[Date], -1, YEAR )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this helped, please consider giving kudos and mark as a solution&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="273" data-lia-user-login="me" class="lia-mention lia-mention-user"&gt;me&lt;/a&gt; in replies or I'll lose your thread&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Want to check your DAX skills? &lt;A href="https://www.linkedin.com/company/kubisco/" target="_blank"&gt;Answer my biweekly DAX challenges on the kubisco Linkedin page&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Consider voting &lt;A href="https://community.fabric.microsoft.com/t5/Fabric-Ideas/Power-BI-Filter-Pane-as-an-icon-on-the-right-side-bar-in-on/idi-p/4728588" target="_blank"&gt;this Power BI idea&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Francesco Bergamaschi&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MBA, M.Eng, M.Econ, Professor of BI&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2025 08:15:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4789827#M183345</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2025-08-07T08:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4790837#M183378</link>
      <description>&lt;P&gt;Thanks for the reply, but all this does it shift the full year's data one year.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It doesn't report the data as at the equvilant date in prior years.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 04:58:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4790837#M183378</guid>
      <dc:creator>greenskmachine</dc:creator>
      <dc:date>2025-08-08T04:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4790849#M183379</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640707" data-lia-user-login="greenskmachine" class="lia-mention lia-mention-user"&gt;greenskmachine&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
VAR maxDate = CALCULATE(MAX(Weight[ProcessedDate]), ALL())
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[Fiscal Day of Year]), DIM_DATE[Date] = maxDate)
RETURN
CALCULATE(SUM(Weight[Weight]), DIM_DATE[Fiscal Day of Year] &amp;lt;= dayPeriod)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;For YTD:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FiscalYearToDate =
VAR maxDate = CALCULATE(MAX(DIM_DATE[Date]), ALL(Weight))
VAR currFiscalYear = CALCULATE(MAX(DIM_DATE[FiscalYear]), DIM_DATE[Date] = maxDate)
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[FiscalDayOfYear]), DIM_DATE[Date] = maxDate)
RETURN
CALCULATE(
    SUM(Weight[Weight]),
    DIM_DATE[FiscalYear] = currFiscalYear,
    DIM_DATE[FiscalDayOfYear] &amp;lt;= dayPeriod
)

FiscalYearToDatePrevYear =
VAR maxDate = CALCULATE(MAX(DIM_DATE[Date]), ALL(Weight))
VAR dayPeriod = CALCULATE(MAX(DIM_DATE[FiscalDayOfYear]), DIM_DATE[Date] = maxDate)
VAR prevFiscalYear = CALCULATE(MAX(DIM_DATE[FiscalYear]), DIM_DATE[Date] = maxDate) - 1
RETURN
CALCULATE(
    SUM(Weight[Weight]),
    DIM_DATE[FiscalYear] = prevFiscalYear,
    DIM_DATE[FiscalDayOfYear] &amp;lt;= dayPeriod
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Aug 2025 05:09:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4790849#M183379</guid>
      <dc:creator>MohamedFowzan1</dc:creator>
      <dc:date>2025-08-08T05:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4792070#M183419</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640707" data-lia-user-login="greenskmachine" class="lia-mention lia-mention-user"&gt;greenskmachine&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has your issue been resolved?&lt;BR /&gt;If the response provided by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="695049" data-lia-user-login="MohamedFowzan1" class="lia-mention lia-mention-user"&gt;MohamedFowzan1&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1287762" data-lia-user-login="FBergamaschi" class="lia-mention lia-mention-user"&gt;FBergamaschi&lt;/a&gt;&amp;nbsp; addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your understanding!&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Aug 2025 17:22:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4792070#M183419</guid>
      <dc:creator>v-sgandrathi</dc:creator>
      <dc:date>2025-08-09T17:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4794386#M183489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640707" data-lia-user-login="greenskmachine" class="lia-mention lia-mention-user"&gt;greenskmachine&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Just checking in -- have you had a chance to review and try the provided solution? Kindly share the status whenever you get a chance.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Looking forward to your response.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 11:39:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4794386#M183489</guid>
      <dc:creator>v-sgandrathi</dc:creator>
      <dc:date>2025-08-12T11:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4798505#M183605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="640707" data-lia-user-login="greenskmachine" class="lia-mention lia-mention-user"&gt;greenskmachine&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;As we have not received a response from you yet, I would like to confirm whether you have successfully resolved the issue or if you require further assistance.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Aug 2025 06:25:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4798505#M183605</guid>
      <dc:creator>v-sgandrathi</dc:creator>
      <dc:date>2025-08-16T06:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data as at same date in previous years</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4804444#M183779</link>
      <description>&lt;P&gt;Use Month+Day instead of “Fiscal Day of Year” to avoid leap year issues.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure YTD Safe =&lt;BR /&gt;VAR maxDate = CALCULATE(MAX(Weight[ProcessedDate]), ALL(Weight))&lt;BR /&gt;VAR maxMD = VALUE(FORMAT(maxDate, "MMdd"))&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Weight[Weight]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL(DIM_DATE),&lt;BR /&gt;VALUE(FORMAT(DIM_DATE[Date], "MMdd")) &amp;lt;= maxMD&lt;BR /&gt;&amp;amp;&amp;amp; DIM_DATE[Date] &amp;gt;= DATE(YEAR(DIM_DATE[Date]),7,1) // fiscal year start&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 04:38:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-as-at-same-date-in-previous-years/m-p/4804444#M183779</guid>
      <dc:creator>Shahid12523</dc:creator>
      <dc:date>2025-08-22T04:38:29Z</dc:date>
    </item>
  </channel>
</rss>

