<?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: Same day Last Month - Month not continuous in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166528#M113899</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I assume you have a date dim table in the model.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file. I tired to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;I hope the below can provide some ideas on how to create a solution for your datamodel.&lt;/P&gt;
&lt;P&gt;&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Prev month value measure: =
VAR _prevmonthdate =
    CALCULATE ( MAX ( 'Calendar'[Date] ), DATEADD ( 'Calendar'[Date], -1, MONTH ) )
VAR _alldatesbeforeprevmonthdate =
    ADDCOLUMNS (
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] &amp;lt;= _prevmonthdate ),
        "@value", [Value measure:]
    )
VAR _nonblankvaluelatestdatebeforeprevmonthdate =
    MAXX (
        FILTER ( _alldatesbeforeprevmonthdate, [@value] &amp;lt;&amp;gt; BLANK () ),
        'Calendar'[Date]
    )
RETURN
    IF (
        NOT ISBLANK ( [Value measure:] ),
        CALCULATE (
            [Value measure:],
            'Calendar'[Date] = _nonblankvaluelatestdatebeforeprevmonthdate
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 20:12:22 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-03-31T20:12:22Z</dc:date>
    <item>
      <title>Same day Last Month - Month not continuous</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166403#M113893</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a column with number of customers of the day, i need to compare it with the same day last month, the problem is that i don't have all days in my table, i don't have weekends and holidays, because there are no customers these days. For these days i need to find the closest day.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;day 23/03/2023 (717) i want to compare with 23/02/2023 (817)&lt;/P&gt;&lt;P&gt;day 22/03/2023 (773) i want to compare with 17/02/2023 (758), because I don't have 22/02/2023 so the next available day is 17/02&lt;/P&gt;&lt;P&gt;&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;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 18:16:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166403#M113893</guid>
      <dc:creator>Gionedis</dc:creator>
      <dc:date>2023-03-31T18:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Same day Last Month - Month not continuous</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166528#M113899</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I assume you have a date dim table in the model.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file. I tired to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;I hope the below can provide some ideas on how to create a solution for your datamodel.&lt;/P&gt;
&lt;P&gt;&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Prev month value measure: =
VAR _prevmonthdate =
    CALCULATE ( MAX ( 'Calendar'[Date] ), DATEADD ( 'Calendar'[Date], -1, MONTH ) )
VAR _alldatesbeforeprevmonthdate =
    ADDCOLUMNS (
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] &amp;lt;= _prevmonthdate ),
        "@value", [Value measure:]
    )
VAR _nonblankvaluelatestdatebeforeprevmonthdate =
    MAXX (
        FILTER ( _alldatesbeforeprevmonthdate, [@value] &amp;lt;&amp;gt; BLANK () ),
        'Calendar'[Date]
    )
RETURN
    IF (
        NOT ISBLANK ( [Value measure:] ),
        CALCULATE (
            [Value measure:],
            'Calendar'[Date] = _nonblankvaluelatestdatebeforeprevmonthdate
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 20:12:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166528#M113899</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-03-31T20:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Same day Last Month - Month not continuous</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166550#M113902</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 20:51:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166550#M113902</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2023-03-31T20:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Same day Last Month - Month not continuous</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166570#M113904</link>
      <description>&lt;P&gt;Works like a Charm Thanks, I'll study this formula to understand in the future, Thank you, my friend&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 21:08:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Same-day-Last-Month-Month-not-continuous/m-p/3166570#M113904</guid>
      <dc:creator>Gionedis</dc:creator>
      <dc:date>2023-03-31T21:08:01Z</dc:date>
    </item>
  </channel>
</rss>

