<?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 from January in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2272563#M55372</link>
    <description>&lt;P&gt;My first guess would be that you might have a year filter context that's combining with PREVIOUSMONTH resulting in nothing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide a simple example or .pbix that we can test against?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jan 2022 21:15:19 GMT</pubDate>
    <dc:creator>AlexisOlson</dc:creator>
    <dc:date>2022-01-07T21:15:19Z</dc:date>
    <item>
      <title>Previous Month from January</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2272559#M55371</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Not a new issue and shocking that it still hasn't been resolved.&amp;nbsp; I posted this under issues already but if anyone has a workaround that actually works I would be most grateful.&amp;nbsp; If you have a PBI report that provides numbers from the Previous Month, none of the functions PREVIOUSMONTH, PARALLELPERIOD, or DATEADD will return values if you happen to be reporting from the month of January.&amp;nbsp; They all return nothing.&amp;nbsp; It would seem none have been coded to look back to the previous year when the month=January.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;I've searched for workarounds but so far none have functioned as-advertised.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had been using a Measure:&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;Sales Prev MO = CALCULATE([Total Sales], PREVIOUSMONTH(Dates[sDate]))&amp;nbsp; which works fine for every month except January.&amp;nbsp; So I attempted to trap for January and tried several permutations of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sales Prev MO = IF(MONTH([LDate])&amp;gt;1,CALCULATE([Total Sales], PREVIOUSMONTH(Dates[sDate])) ,CALCULATE([Total Sales],*** nothing I've tried here works.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I've tried PARALLELPERIOD, DATEADD, and a hail Mary combining PREVIOUSYEAR with PREVIOUSMONTH.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any sugestions?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 07 Jan 2022 21:12:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2272559#M55371</guid>
      <dc:creator>jtma508</dc:creator>
      <dc:date>2022-01-07T21:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month from January</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2272563#M55372</link>
      <description>&lt;P&gt;My first guess would be that you might have a year filter context that's combining with PREVIOUSMONTH resulting in nothing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide a simple example or .pbix that we can test against?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 21:15:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2272563#M55372</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-07T21:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month from January</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2273046#M55376</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323557" data-lia-user-login="jtma508" class="lia-mention lia-mention-user"&gt;jtma508&lt;/a&gt; , Please check the suggestion from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp; and also check if your calendar is complete.&lt;/P&gt;
&lt;P&gt;1. if the dates are missing in the calendar &lt;/P&gt;
&lt;P&gt;2. Do you have timestamp in dates in your fact for Jan. Date join should be on column without timestamp&lt;/P&gt;
&lt;P&gt;3. calendar&amp;nbsp; table si marked as date table&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :&lt;A href="https://youtu.be/OBf0rjpp5Hw" target="_blank"&gt;https://youtu.be/OBf0rjpp5Hw&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4" target="_blank"&gt;https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 03:49:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2273046#M55376</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-01-08T03:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Month from January</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2279127#M55709</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="323557" data-lia-user-login="jtma508" class="lia-mention lia-mention-user"&gt;jtma508&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works fine on my side.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales Prev MO = CALCULATE(SUM('Table'[value]), PREVIOUSMONTH('calendar'[date]))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;My Power BI Desktop version is&amp;nbsp;December 2021. Try upgrading your application and check again.&lt;/P&gt;
&lt;P&gt;Or you could try using below formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales Prev MO = CALCULATE(SUM('Table'[value]), FILTER(ALLSELECTED('Table'),FORMAT('Table'[date],"YYYYMM") = FORMAT(EDATE(SELECTEDVALUE('calendar'[date]),-1),"YYYYMM")))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 08:59:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Previous-Month-from-January/m-p/2279127#M55709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-12T08:59:25Z</dc:date>
    </item>
  </channel>
</rss>

