<?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: Start of Month based on Previous Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Start-of-Month-based-on-Previous-Date/m-p/1503194#M29105</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="158297" data-lia-user-login="BlueTeam1" class="lia-mention lia-mention-user"&gt;BlueTeam1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VAR end_ = 'Calendar'[Date]-1&lt;/P&gt;
&lt;P&gt;VAR start_ = DATE(YEAR(end_), MONTH(end_), 1)&lt;/P&gt;
&lt;P&gt;and then you can use those vars in the filter operation&amp;nbsp; You do not specify if this is to be used in a measure or a calc column. If the former, you´ll need a SELECTEDVALUE( ) in end_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&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;</description>
    <pubDate>Wed, 18 Nov 2020 22:31:01 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2020-11-18T22:31:01Z</dc:date>
    <item>
      <title>Start of Month based on Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Start-of-Month-based-on-Previous-Date/m-p/1503185#M29104</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help with some dax. I need to find the first of the TOTALMTD() however it needs to be based on the previous day.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Examples:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If I provide the date 10/31/2020, it should provide the TOTALMTD() between 10/1/2020 and 10/30/2020.&lt;/LI&gt;&lt;LI&gt;If I provide 11/1/2020, it should provide 10/1/2020 to 10/31/2020.&lt;/LI&gt;&lt;LI&gt;If I provide 11/2/2020, it provides TOTALMTD() for 11/1/2020.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is what I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;first of month of previous day = var _prev_day =&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;PREVIOUSDAY('Calendar'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var first_of_month = CALCULATE(STARTOFMONTH('Calendar'[Date]),YEAR('Calendar'[Date]) = YEAR([Previous Date]), MONTH('Calendar'[Date]) = MONTH([Previous Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return first_of_month &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I can't seem to get the filters to work correctly. Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 22:20:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Start-of-Month-based-on-Previous-Date/m-p/1503185#M29104</guid>
      <dc:creator>BlueTeam1</dc:creator>
      <dc:date>2020-11-18T22:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Start of Month based on Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Start-of-Month-based-on-Previous-Date/m-p/1503194#M29105</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="158297" data-lia-user-login="BlueTeam1" class="lia-mention lia-mention-user"&gt;BlueTeam1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VAR end_ = 'Calendar'[Date]-1&lt;/P&gt;
&lt;P&gt;VAR start_ = DATE(YEAR(end_), MONTH(end_), 1)&lt;/P&gt;
&lt;P&gt;and then you can use those vars in the filter operation&amp;nbsp; You do not specify if this is to be used in a measure or a calc column. If the former, you´ll need a SELECTEDVALUE( ) in end_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&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;</description>
      <pubDate>Wed, 18 Nov 2020 22:31:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Start-of-Month-based-on-Previous-Date/m-p/1503194#M29105</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-11-18T22:31:01Z</dc:date>
    </item>
  </channel>
</rss>

