<?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: Help with sales measure between two dates for custom calendar in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4919058#M186774</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="659294" data-lia-user-login="alaynanich" class="lia-mention lia-mention-user"&gt;alaynanich&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Have you had a chance to review the solution we shared by &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;&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;&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;? If the issue persists, feel free to reply so we can help further.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jan 2026 04:32:33 GMT</pubDate>
    <dc:creator>v-saisrao-msft</dc:creator>
    <dc:date>2026-01-16T04:32:33Z</dc:date>
    <item>
      <title>Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915687#M186692</link>
      <description>&lt;P&gt;Hi, I know this is a common ask but I'm stuck on this Dax measure. Basically, I need to calculate the sales variance betwen two dates in my date table for any slice/dimension my user needs. I'm used to using the dateadd or sameperiodlastyear functions for this, but I'm stuck since I'm using custom dates for our new fiscal year calendar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My sales table comes in weekly with a week start column, and a list of stores and products&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;For my date table, I added a "this year" and 'last year" column for the comparison dates. Corpweekstart is connected to my date in this table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the below DAX for YOY sales which works perfeclt in a weekly view. But it appears blank when i look at it in total or as years. From what I've read, it's because of SELECTEDVALUE() and I think i need to use HASONEVALUE() or ISINSCOPE() instead? But I'm not sure if that's correct or what field to use it with?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR ty = SUM(Sales_Agg[sales])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR PrevWeekStart = SELECTEDVALUE ( 'adhoc_ace_date'[ly_week_start] )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR ly =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; IF (&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOT ISBLANK ( PrevWeekStart ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE ( SUM(Sales_Agg[sales]), TREATAS ( { PrevWeekStart }, 'adhoc_ace_date'[ace_date] ) ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BLANK ()&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; )&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RETURN IF (ISBLANK( ly ), BLANK (), (ty - ly))&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It works fine when I look at it weekly, but not yearly (or any other dimension).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 19:41:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915687#M186692</guid>
      <dc:creator>alaynanich</dc:creator>
      <dc:date>2026-01-09T19:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915691#M186693</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="659294" data-lia-user-login="alaynanich" class="lia-mention lia-mention-user"&gt;alaynanich&lt;/a&gt;&amp;nbsp;SELECTEDVALUE will return blank by default if there are multiple values available (like in a total row). You can try using MAX or MIN instead.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 19:59:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915691#M186693</guid>
      <dc:creator>GeraldGEmerick</dc:creator>
      <dc:date>2026-01-09T19:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915693#M186694</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1338394" data-lia-user-login="GeraldGEmerick" class="lia-mention lia-mention-user"&gt;GeraldGEmerick&lt;/a&gt;&amp;nbsp;Oh wow this was so simple to remove the blanks. Thanks!!! But the total row is still blank at the bottom of the tables - is there another simple fix for this?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 20:07:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915693#M186694</guid>
      <dc:creator>alaynanich</dc:creator>
      <dc:date>2026-01-09T20:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915694#M186695</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="659294" data-lia-user-login="alaynanich" class="lia-mention lia-mention-user"&gt;alaynanich&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;at the total I am not sure to get the meaning of the calculation and a YOY is undefined when there are multiple years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the meaning you want to give to that value at the matruix total? Then we can fix the DAX&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;@me 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>Fri, 09 Jan 2026 20:17:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915694#M186695</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2026-01-09T20:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915697#M186696</link>
      <description>&lt;P&gt;&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;Hi, for the total YOY I want it to dynamically sum up whatever context is in the visual if that makes sense?&amp;nbsp; So on a weekly level, total the YOY for this year's sales vs the associated week from last year. On an annual level, full 2025 sales vs full 2024 sales.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 20:25:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915697#M186696</guid>
      <dc:creator>alaynanich</dc:creator>
      <dc:date>2026-01-09T20:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915709#M186698</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="659294" data-lia-user-login="alaynanich" class="lia-mention lia-mention-user"&gt;alaynanich&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;YoY=&lt;/P&gt;&lt;P&gt;SUMX(&lt;/P&gt;&lt;P&gt;VALUES('adhoc_ace_date'[ace_date] ),&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;/P&gt;&lt;P&gt;VAR ty = SUM(Sales_Agg[sales])&lt;/P&gt;&lt;P&gt;VAR PrevWeekStart = MAX ( 'adhoc_ace_date'[ly_week_start] )&lt;/P&gt;&lt;P&gt;VAR ly =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; IF (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOT ISBLANK ( PrevWeekStart ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE ( SUM(Sales_Agg[sales]), TREATAS ( { PrevWeekStart }, 'adhoc_ace_date'[ace_date] ) ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BLANK ()&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN IF (ISBLANK( ly ), BLANK (), (ty - ly))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jan 2026 21:38:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915709#M186698</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2026-01-09T21:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915817#M186699</link>
      <description>&lt;P&gt;Please try the formulas below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales TY =
SUM ( Sales_Agg[sales] )

Sales LY =
CALCULATE(
    [Sales TY],
    TREATAS(
        VALUES ( 'adhoc_ace_date'[ly_week_start] ),
        'adhoc_ace_date'[ace_date]
    )
)

YoY Variance =
VAR ty = [Sales TY]
VAR ly = [Sales LY]
RETURN
IF ( ISBLANK(ly), BLANK(), ty - ly )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jan 2026 06:50:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915817#M186699</guid>
      <dc:creator>cengizhanarslan</dc:creator>
      <dc:date>2026-01-10T06:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915877#M186700</link>
      <description>&lt;P&gt;OK in this case I am not sure shy it still does not work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share the pbix via private message so I can check it?&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>Sat, 10 Jan 2026 11:31:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4915877#M186700</guid>
      <dc:creator>FBergamaschi</dc:creator>
      <dc:date>2026-01-10T11:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4919058#M186774</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="659294" data-lia-user-login="alaynanich" class="lia-mention lia-mention-user"&gt;alaynanich&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Have you had a chance to review the solution we shared by &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;&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;&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;? If the issue persists, feel free to reply so we can help further.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2026 04:32:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4919058#M186774</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2026-01-16T04:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with sales measure between two dates for custom calendar</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4919699#M186794</link>
      <description>&lt;P&gt;Both solutions below worked - thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2026 21:10:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-sales-measure-between-two-dates-for-custom-calendar/m-p/4919699#M186794</guid>
      <dc:creator>alaynanich</dc:creator>
      <dc:date>2026-01-16T21:10:22Z</dc:date>
    </item>
  </channel>
</rss>

