<?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 Need to calculate sales for current month, next month and next 6months (26 weeks+current week) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4093591#M162444</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need to calculate sales for current month, next month and next 6months (26 weeks including current week)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bleow is the example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sales for current month Aug&amp;nbsp; = 1800&lt;/P&gt;&lt;P&gt;sales for Next month Sep&amp;nbsp; = 2816&lt;/P&gt;&lt;P&gt;sales for Next 6 months (26 weeks starting from 05-08-2024)&amp;nbsp; = 12672&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Aug 2024 05:22:22 GMT</pubDate>
    <dc:creator>srikanth571</dc:creator>
    <dc:date>2024-08-11T05:22:22Z</dc:date>
    <item>
      <title>Need to calculate sales for current month, next month and next 6months (26 weeks+current week)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4093591#M162444</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need to calculate sales for current month, next month and next 6months (26 weeks including current week)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bleow is the example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sales for current month Aug&amp;nbsp; = 1800&lt;/P&gt;&lt;P&gt;sales for Next month Sep&amp;nbsp; = 2816&lt;/P&gt;&lt;P&gt;sales for Next 6 months (26 weeks starting from 05-08-2024)&amp;nbsp; = 12672&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2024 05:22:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4093591#M162444</guid>
      <dc:creator>srikanth571</dc:creator>
      <dc:date>2024-08-11T05:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need to calculate sales for current month, next month and next 6months (26 weeks+current week)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4093847#M162456</link>
      <description>&lt;P&gt;Weeks and months are incompatible.&amp;nbsp; Is your data on day level?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2024 17:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4093847#M162456</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-08-11T17:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need to calculate sales for current month, next month and next 6months (26 weeks+current week)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4094367#M162477</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kindly refer below link to access the sample data for above requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Raw data" href="https://drive.google.com/file/d/1hGgPmGMSKZ41DCzQR7xj15pNxMFM7sDD/view" target="_self"&gt;https://drive.google.com/file/d/1hGgPmGMSKZ41DCzQR7xj15pNxMFM7sDD/view&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 03:33:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4094367#M162477</guid>
      <dc:creator>srikanth571</dc:creator>
      <dc:date>2024-08-12T03:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to calculate sales for current month, next month and next 6months (26 weeks+current week)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4096693#M162577</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="618646" data-lia-user-login="srikanth571" class="lia-mention lia-mention-user"&gt;srikanth571&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;For [CurrentMonthSales], [NextMonthSales] we can create a new calendar table like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then create a relationship between [Date] and [Week]:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then please create follow measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CurrentMonthSales = 
CALCULATE(
    SUM('Table'[Sales]),
    'Calendar'[YearMonthIndex] = YEAR(TODAY())*12+MONTH(TODAY())
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;NextMonthSales = 
CALCULATE(
    SUM('Table'[Sales]),
    'Calendar'[YearMonthIndex] = YEAR(TODAY())*12+MONTH(TODAY()) + 1
)&lt;/LI-CODE&gt;
&lt;P&gt;For [Next6MonthsSales], I observe that Week is calculated from the 1st of the month, and here I am assuming that the actual data is continuous as you have given. I have added a new [WeekIndex] column in PowerQuery:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then create this measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Next6MonthsSales = 
VAR __cur_week_index = CALCULATE(MAX('Table'[WeekIndex]), 'Calendar'[Date]&amp;lt;=TODAY())
VAR __result = CALCULATE(SUM('Table'[Sales]),'Table'[WeekIndex]&amp;gt;=__cur_week_index &amp;amp;&amp;amp; 'Table'[WeekIndex]&amp;lt;=__cur_week_index+25)
RETURN
__result&lt;/LI-CODE&gt;
&lt;P&gt;output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Best Regards,&lt;BR /&gt;Gao&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Community Support Team&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;If there is any post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3" color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT size="3"&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008080"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT size="3"&gt;Thanks a lot!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="2" color="#FF0000"&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank" rel="noopener nofollow noreferrer"&gt;How to get your questions answered quickly&lt;/A&gt;&amp;nbsp;--&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank" rel="noopener nofollow noreferrer"&gt;&amp;nbsp;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2024 05:43:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4096693#M162577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-13T05:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to calculate sales for current month, next month and next 6months (26 weeks+current week)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4104060#M162855</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to figure out from other forum topics, thanks all for your help.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2024 10:38:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-calculate-sales-for-current-month-next-month-and-next/m-p/4104060#M162855</guid>
      <dc:creator>srikanth571</dc:creator>
      <dc:date>2024-08-16T10:38:56Z</dc:date>
    </item>
  </channel>
</rss>

