<?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: Dax: Previous Month calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/3682973#M143040</link>
    <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;month = CALCULATE(MAX('date'[Date]), PREVIOUSMONTH('date'[Date]))&lt;/DIV&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;MAX('date'[Date]): This function calculates the maximum date from the 'Date' column of your 'date' table.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;PREVIOUSMONTH('date'[Date]): This function returns a table containing dates from the previous month, considering all dates in the 'Date' column of your 'date' table.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;CALCULATE: This function evaluates an expression in a modified filter context.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;So, when you use CALCULATE with MAX and PREVIOUSMONTH, you're instructing Power BI to calculate the maximum date from the previous month based on the dates in your 'date' table. Your measure will dynamically adjust as the current month changes, always showing the maximum date from the previous month.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;This DAX measure should work effectively for your requirement.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;in my data set&amp;nbsp; upto 31 jan 2024 data have . so..&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;max prevoius month&amp;nbsp; should be 31 dec 2023&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;hope this alternative&amp;nbsp; is userful for you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 12:25:55 GMT</pubDate>
    <dc:creator>Anuja_Chaudhari</dc:creator>
    <dc:date>2024-02-06T12:25:55Z</dc:date>
    <item>
      <title>Dax: Previous Month calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/2926612#M96168</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I am trying to create the dax for the Maximum date in the previous month. Could you please share your idea?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 09:31:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/2926612#M96168</guid>
      <dc:creator>Neel98</dc:creator>
      <dc:date>2022-11-24T09:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dax: Previous Month calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/2926873#M96193</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442496" data-lia-user-login="Neel98" class="lia-mention lia-mention-user"&gt;Neel98&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;Hope you have a datedimension table in your data set, if not create that first and create a one to many relationship from your date table to this table and create the below measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CALCULATE(&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MAX(Report Date),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;DATEADD('Date Dimension'[date],-1,MONTH)&lt;BR /&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;BR /&gt;Nikhil Chenna&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 10:41:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/2926873#M96193</guid>
      <dc:creator>NikhilChenna</dc:creator>
      <dc:date>2022-11-24T10:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dax: Previous Month calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/3682973#M143040</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;month = CALCULATE(MAX('date'[Date]), PREVIOUSMONTH('date'[Date]))&lt;/DIV&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;MAX('date'[Date]): This function calculates the maximum date from the 'Date' column of your 'date' table.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;PREVIOUSMONTH('date'[Date]): This function returns a table containing dates from the previous month, considering all dates in the 'Date' column of your 'date' table.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;CALCULATE: This function evaluates an expression in a modified filter context.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;So, when you use CALCULATE with MAX and PREVIOUSMONTH, you're instructing Power BI to calculate the maximum date from the previous month based on the dates in your 'date' table. Your measure will dynamically adjust as the current month changes, always showing the maximum date from the previous month.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;This DAX measure should work effectively for your requirement.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;in my data set&amp;nbsp; upto 31 jan 2024 data have . so..&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;max prevoius month&amp;nbsp; should be 31 dec 2023&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;hope this alternative&amp;nbsp; is userful for you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 12:25:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Previous-Month-calculation/m-p/3682973#M143040</guid>
      <dc:creator>Anuja_Chaudhari</dc:creator>
      <dc:date>2024-02-06T12:25:55Z</dc:date>
    </item>
  </channel>
</rss>

