<?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: Need to get previous month date by creating a DAX measure. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246346#M119605</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really wanna use a measure, you can try this one:&lt;/P&gt;
&lt;PRE&gt;DateMeasure = 
VAR _year = YEAR ( SELECTEDVALUE ( TablePivot[Date] ) )
VAR _month = MONTH ( SELECTEDVALUE ( TablePivot[Date] ) )
VAR _day = DAY ( SELECTEDVALUE ( TablePivot[Date] ) )
RETURN
IFERROR ( DATE ( _year, _month - 1, _day), EOMONTH ( DATE ( _year, _month, 1 ), 0 ) )&lt;/PRE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 03:21:06 GMT</pubDate>
    <dc:creator>tackytechtom</dc:creator>
    <dc:date>2023-05-22T03:21:06Z</dc:date>
    <item>
      <title>Need to get previous month date by creating a DAX measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246211#M119600</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435045" data-lia-user-login="PBI_Member_01" class="lia-mention lia-mention-user"&gt;PBI_Member_01&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to see the previous month date against the existing date column in my dataset.&lt;/P&gt;&lt;P&gt;For e.g. If column DOJ shows the date 15/09/22, the measure should show 15/08/22.&lt;/P&gt;&lt;P&gt;We can achieve this output in Calculated Column by writing following DAX&amp;nbsp;&lt;/P&gt;&lt;P&gt;=Dateadd(DOJ,-1,MONTH)&lt;/P&gt;&lt;P&gt;However I am not sure how can we achieve the same result by writing a measure.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 01:55:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246211#M119600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-22T01:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get previous month date by creating a DAX measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246329#M119604</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My tip here is to use a date dimension and precalculate this "samedaypreviousmonth" attribute already in the dimension instead of creating a separate measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 03:13:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246329#M119604</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2023-05-22T03:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get previous month date by creating a DAX measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246346#M119605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really wanna use a measure, you can try this one:&lt;/P&gt;
&lt;PRE&gt;DateMeasure = 
VAR _year = YEAR ( SELECTEDVALUE ( TablePivot[Date] ) )
VAR _month = MONTH ( SELECTEDVALUE ( TablePivot[Date] ) )
VAR _day = DAY ( SELECTEDVALUE ( TablePivot[Date] ) )
RETURN
IFERROR ( DATE ( _year, _month - 1, _day), EOMONTH ( DATE ( _year, _month, 1 ), 0 ) )&lt;/PRE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 03:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246346#M119605</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2023-05-22T03:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get previous month date by creating a DAX measure.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246410#M119610</link>
      <description>&lt;P&gt;Yes, It does. Thanks a lot for quick solution&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 04:01:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-get-previous-month-date-by-creating-a-DAX-measure/m-p/3246410#M119610</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-22T04:01:09Z</dc:date>
    </item>
  </channel>
</rss>

