<?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: Assistance with DAX Calculation for Previous Month Values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4349166#M172735</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What fields are you using in the visual object? Is it the 'Date' or 'Month' column? Can you provide some simple data or screenshots?&lt;/P&gt;
&lt;P&gt;If you are unsure how to upload data please refer to&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 03:15:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-01-03T03:15:15Z</dc:date>
    <item>
      <title>Assistance with DAX Calculation for Previous Month Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348365#M172709</link>
      <description>&lt;P&gt;Hi Community Members,&lt;/P&gt;&lt;P&gt;I’m using the following DAX to calculate the value for the previous month. If the previous month's value is unavailable, it should default to the second previous month's value, and this logic should continue for up to 13 months to retrieve the correct values.&lt;/P&gt;&lt;P&gt;The DAX below works fine for individual calculations, but I’m encountering an issue where the total is not adding up correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Value Last 13 Months Previous Month =
SUMX(
VALUES('Calendar'[Date]),
VAR Month1 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
PREVIOUSMONTH ( 'Calendar'[Date] )
)
VAR Month2 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -2, MONTH )
)
VAR Month3 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -3, MONTH )
)
VAR Month4 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -4, MONTH )
)
VAR Month5 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -5, MONTH )
)
VAR Month6 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -6, MONTH )
)
VAR Month7 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -7, MONTH )
)
VAR Month8 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -8, MONTH )
)
VAR Month9 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -9, MONTH )
)
VAR Month10 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -10, MONTH )
)
VAR Month11 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -11, MONTH )
)
VAR Month12 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -12, MONTH )
)
VAR Month13 =
CALCULATE (
SUM ( vw_Report_1241[Total_AM] ),
DATEADD ( 'Calendar'[Date], -13, MONTH )
)
VAR Result =
IF (
NOT ISBLANK ( Month1 ),
Month1,
IF (
NOT ISBLANK ( Month2 ),
Month2,
IF (
NOT ISBLANK ( Month3 ),
Month3,
IF (
NOT ISBLANK ( Month4 ),
Month4,
IF (
NOT ISBLANK ( Month5 ),
Month5,
IF (
NOT ISBLANK ( Month6 ),
Month6,
IF (
NOT ISBLANK ( Month7 ),
Month7,
IF (
NOT ISBLANK ( Month8 ),
Month8,
IF (
NOT ISBLANK ( Month9 ),
Month9,
IF (
NOT ISBLANK ( Month10 ),
Month10,
IF (
NOT ISBLANK ( Month11 ),
Month11,
IF (
NOT ISBLANK ( Month12 ),
Month12,
Month13
)
)
)
)
)
)
)
)
)
)
)
)
RETURN
Result
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Jan 2025 11:08:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348365#M172709</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2025-01-02T11:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with DAX Calculation for Previous Month Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348376#M172710</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;, Try using&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;Value Last 13 Months Previous Month =&lt;BR /&gt;SUMX(&lt;BR /&gt;SUMMARIZE(&lt;BR /&gt;'Calendar',&lt;BR /&gt;'Calendar'[Date],&lt;BR /&gt;"Result",&lt;BR /&gt;VAR Month1 = CALCULATE(SUM(vw_Report_1241[Total_AM]), PREVIOUSMONTH('Calendar'[Date]))&lt;BR /&gt;VAR Month2 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -2, MONTH))&lt;BR /&gt;VAR Month3 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -3, MONTH))&lt;BR /&gt;VAR Month4 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -4, MONTH))&lt;BR /&gt;VAR Month5 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -5, MONTH))&lt;BR /&gt;VAR Month6 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -6, MONTH))&lt;BR /&gt;VAR Month7 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -7, MONTH))&lt;BR /&gt;VAR Month8 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -8, MONTH))&lt;BR /&gt;VAR Month9 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -9, MONTH))&lt;BR /&gt;VAR Month10 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -10, MONTH))&lt;BR /&gt;VAR Month11 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -11, MONTH))&lt;BR /&gt;VAR Month12 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -12, MONTH))&lt;BR /&gt;VAR Month13 = CALCULATE(SUM(vw_Report_1241[Total_AM]), DATEADD('Calendar'[Date], -13, MONTH))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month1), Month1,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month2), Month2,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month3), Month3,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month4), Month4,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month5), Month5,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month6), Month6,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month7), Month7,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month8), Month8,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month9), Month9,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month10), Month10,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month11), Month11,&lt;BR /&gt;IF(&lt;BR /&gt;NOT ISBLANK(Month12), Month12,&lt;BR /&gt;Month13&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;[Result]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 11:32:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348376#M172710</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-01-02T11:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with DAX Calculation for Previous Month Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348472#M172713</link>
      <description>&lt;P&gt;This is not working. The number is appearing on rows but not summing up on total.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 12:39:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348472#M172713</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2025-01-02T12:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with DAX Calculation for Previous Month Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348509#M172714</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;It depends on the context of the visual where you place the measure in. What does each row in the table visual represent?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 13:46:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4348509#M172714</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2025-01-02T13:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with DAX Calculation for Previous Month Values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4349166#M172735</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="833383" data-lia-user-login="FarhanJeelani" class="lia-mention lia-mention-user"&gt;FarhanJeelani&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What fields are you using in the visual object? Is it the 'Date' or 'Month' column? Can you provide some simple data or screenshots?&lt;/P&gt;
&lt;P&gt;If you are unsure how to upload data please refer to&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;How to provide sample data in the Power BI Forum - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 03:15:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Assistance-with-DAX-Calculation-for-Previous-Month-Values/m-p/4349166#M172735</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-03T03:15:15Z</dc:date>
    </item>
  </channel>
</rss>

