<?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: Previous Month Sales with Month Selected in Slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3370017#M126797</link>
    <description>&lt;P&gt;Firstly, create a proper date table and link it to your fact table. Then you can create measures like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Month Sales =
TOTALMTD ( SUM ( 'Dataset supply chain'[total sale] ), 'Date'[Date] )

Previous Month Sales =
CALCULATE (
    SUM ( 'Dataset supply chain'[total sale] ),
    PREVIOUSMONTH ( 'Date'[Date] )
)
&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 08 Aug 2023 10:12:32 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-08-08T10:12:32Z</dc:date>
    <item>
      <title>Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3369188#M126759</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got stuck with a DAX measure.&lt;BR /&gt;&lt;BR /&gt;I need to calculate the &lt;STRONG&gt;Current Month's&lt;/STRONG&gt; &lt;STRONG&gt;sales&lt;/STRONG&gt; and&amp;nbsp;the &lt;STRONG&gt;Previous Month's sales. &lt;/STRONG&gt;Both the measures are working perfectly if nothing is selected in the date or month slicer.&amp;nbsp;when I select a &lt;STRONG&gt;month&lt;/STRONG&gt; in the slicer then the&amp;nbsp;&lt;STRONG&gt;Previous Month's sales &lt;/STRONG&gt;measure is giving a blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if I select "&lt;STRONG&gt;June&lt;/STRONG&gt;" in the slicer table then the&amp;nbsp;&lt;STRONG&gt;Current Month's&lt;/STRONG&gt; &lt;STRONG&gt;sales &lt;/STRONG&gt;measure should be of&amp;nbsp;&lt;STRONG&gt;June&lt;/STRONG&gt; and the&amp;nbsp;&lt;STRONG&gt;Previous Month's sales &lt;/STRONG&gt;measure should be of &lt;STRONG&gt;May.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My measure are given below:&lt;BR /&gt;&lt;BR /&gt;Current Month Sales =&lt;BR /&gt;TOTALMTD (&lt;BR /&gt;SUM ( 'Dataset supply chain'[total sale] ),&lt;BR /&gt;DATESMTD ( 'Dataset supply chain'[Order date] ))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previous Month Sales =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( 'Dataset supply chain'[total sale] ),&lt;BR /&gt;PREVIOUSMONTH ( DATESMTD ( 'Dataset supply chain'[Order date] ) ))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am also attaching screenshots of the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking forward to&lt;img /&gt;&lt;img /&gt; a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sid&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 22:12:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3369188#M126759</guid>
      <dc:creator>Sid8686</dc:creator>
      <dc:date>2023-08-07T22:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3370017#M126797</link>
      <description>&lt;P&gt;Firstly, create a proper date table and link it to your fact table. Then you can create measures like&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Month Sales =
TOTALMTD ( SUM ( 'Dataset supply chain'[total sale] ), 'Date'[Date] )

Previous Month Sales =
CALCULATE (
    SUM ( 'Dataset supply chain'[total sale] ),
    PREVIOUSMONTH ( 'Date'[Date] )
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 08 Aug 2023 10:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3370017#M126797</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-08-08T10:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3373122#M126971</link>
      <description>&lt;P&gt;Thanks, it works.&lt;BR /&gt;One more question regarding the same visual. how i can calculate the &lt;STRONG&gt;TOP 5 products (by sales) of the Current Month&lt;/STRONG&gt; and the&amp;nbsp;&lt;STRONG&gt;Top 5 products (by sales) of the Previous Month?&amp;nbsp;&lt;/STRONG&gt;I am trying the above measures with the TOPN function but it is giving me error.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 00:39:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3373122#M126971</guid>
      <dc:creator>Sid8686</dc:creator>
      <dc:date>2023-08-10T00:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3373712#M126998</link>
      <description>&lt;P&gt;What is the error message ?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 08:24:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3373712#M126998</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-08-10T08:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3374030#M127028</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Multiple columns cannot be converted to a scalar value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 11:04:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3374030#M127028</guid>
      <dc:creator>Sid8686</dc:creator>
      <dc:date>2023-08-10T11:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3377031#M127173</link>
      <description>&lt;P&gt;Hello , any solution for this query?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2023 21:01:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3377031#M127173</guid>
      <dc:creator>Sid8686</dc:creator>
      <dc:date>2023-08-11T21:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month Sales with Month Selected in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3378253#M127238</link>
      <description>&lt;P&gt;Please do let me know if anyone here helps me how to solve this&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 03:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-Sales-with-Month-Selected-in-Slicer/m-p/3378253#M127238</guid>
      <dc:creator>Sid8686</dc:creator>
      <dc:date>2023-08-14T03:49:24Z</dc:date>
    </item>
  </channel>
</rss>

