<?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: Exclude current month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3995320#M155182</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="288838" data-lia-user-login="Oros" class="lia-mention lia-mention-user"&gt;Oros&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;You just nned to apply filter in your DAX Measure&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales_Excluding_Current_Month = 
VAR CurrentMonth = MONTH(TODAY())
VAR CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
    SUM(Sales[SalesAmount]),
    FILTER(
        Sales,
        YEAR(Sales[Date]) &amp;lt; CurrentYear ||
        (YEAR(Sales[Date]) = CurrentYear &amp;amp;&amp;amp; MONTH(Sales[Date]) &amp;lt; CurrentMonth)
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;If there is any post&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/I&gt;, then please consider&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/I&gt;&amp;nbsp; 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.&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Thanks a lot!&lt;/STRONG&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 04:58:50 GMT</pubDate>
    <dc:creator>manvishah17</dc:creator>
    <dc:date>2024-06-17T04:58:50Z</dc:date>
    <item>
      <title>Exclude current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3994997#M155161</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a monthly sales data in the last 3 years.&amp;nbsp; I would like to create line chart that shows monthly sales in the last 3 years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the measure to exclude the current month, or to exclude if the month is still not finished? Thanks.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, for the 2024, since June is still not finished, the 2024 chart line should stop in the month of May.&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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 00:20:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3994997#M155161</guid>
      <dc:creator>Oros</dc:creator>
      <dc:date>2024-06-17T00:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3995320#M155182</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="288838" data-lia-user-login="Oros" class="lia-mention lia-mention-user"&gt;Oros&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;You just nned to apply filter in your DAX Measure&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sales_Excluding_Current_Month = 
VAR CurrentMonth = MONTH(TODAY())
VAR CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
    SUM(Sales[SalesAmount]),
    FILTER(
        Sales,
        YEAR(Sales[Date]) &amp;lt; CurrentYear ||
        (YEAR(Sales[Date]) = CurrentYear &amp;amp;&amp;amp; MONTH(Sales[Date]) &amp;lt; CurrentMonth)
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;If there is any post&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/I&gt;, then please consider&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/I&gt;&amp;nbsp; 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.&amp;nbsp;&lt;I&gt;&lt;STRONG&gt;Thanks a lot!&lt;/STRONG&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 04:58:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3995320#M155182</guid>
      <dc:creator>manvishah17</dc:creator>
      <dc:date>2024-06-17T04:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3995877#M155233</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="288838" data-lia-user-login="Oros" class="lia-mention lia-mention-user"&gt;Oros&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;you should use a date table/Calender table and use the measure below.&lt;BR /&gt;&lt;BR /&gt;Total Sales =&lt;BR /&gt;VAR CurrentMonth = MAX('Date'[Date])&lt;BR /&gt;VAR LastMonth = CALCULATE(MAX('Date'[Date]), ALL('Date'))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;CurrentMonth = LastMonth,&lt;BR /&gt;BLANK(), -- Exclude current month if it's the last available month&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Sales'[SalesAmount]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Date'),&lt;BR /&gt;'Date'[Date] &amp;lt;= LastMonth -- Include months up to the last completed month&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 10:25:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3995877#M155233</guid>
      <dc:creator>johnbasha33</dc:creator>
      <dc:date>2024-06-17T10:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3996038#M155252</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="705760" data-lia-user-login="manvishah17" class="lia-mention lia-mention-user"&gt;manvishah17&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works!!! Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:58:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3996038#M155252</guid>
      <dc:creator>Oros</dc:creator>
      <dc:date>2024-06-17T11:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3996042#M155253</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="585150" data-lia-user-login="johnbasha33" class="lia-mention lia-mention-user"&gt;johnbasha33&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping.&amp;nbsp; Your solution works as well!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 11:59:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Exclude-current-month/m-p/3996042#M155253</guid>
      <dc:creator>Oros</dc:creator>
      <dc:date>2024-06-17T11:59:37Z</dc:date>
    </item>
  </channel>
</rss>

