<?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 Help with DATEADD in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DATEADD/m-p/4293115#M170369</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a date table joined to a fact table and I'm counting rows in the fact table.&lt;/P&gt;&lt;P&gt;The ultimate goal is to be able to count the rows in the fact table where the date is before the Max Date, which is the most recent date for which there is data (19/11/2024). I also want to be able to do the same for last year i.e. count rows where the date is prior to 19/11/2023.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;To do this I need to calculate the most recent date for which there is data and I have achieved this with the following code:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However, as you can see, the Max Date with DATEADD is not returning 19/11/2023 as I wanted it to. It is returning the max date per month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;How can the Max Date measure be written in such a way that when used in a DATEADD function, it returns the same date a year ago, for all rows?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2024 10:36:43 GMT</pubDate>
    <dc:creator>alexggrantham</dc:creator>
    <dc:date>2024-11-20T10:36:43Z</dc:date>
    <item>
      <title>Help with DATEADD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DATEADD/m-p/4293115#M170369</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a date table joined to a fact table and I'm counting rows in the fact table.&lt;/P&gt;&lt;P&gt;The ultimate goal is to be able to count the rows in the fact table where the date is before the Max Date, which is the most recent date for which there is data (19/11/2024). I also want to be able to do the same for last year i.e. count rows where the date is prior to 19/11/2023.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;To do this I need to calculate the most recent date for which there is data and I have achieved this with the following code:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;However, as you can see, the Max Date with DATEADD is not returning 19/11/2023 as I wanted it to. It is returning the max date per month.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;How can the Max Date measure be written in such a way that when used in a DATEADD function, it returns the same date a year ago, for all rows?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 10:36:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DATEADD/m-p/4293115#M170369</guid>
      <dc:creator>alexggrantham</dc:creator>
      <dc:date>2024-11-20T10:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with DATEADD</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DATEADD/m-p/4293400#M170393</link>
      <description>&lt;P&gt;Try This&lt;/P&gt;&lt;P&gt;Max date dateadd = calculate([Max Date],dateadd(date[Max Date],-1,Year))&lt;BR /&gt;alternate&lt;BR /&gt;Max date dateadd =&lt;/P&gt;&lt;P&gt;var _day = day([Max Date])&lt;BR /&gt;Var _month = Month([Max Date])&lt;BR /&gt;Var _Year_P = Year([Max Date])-1&lt;BR /&gt;Return&lt;BR /&gt;date(_year_P,_month,_day)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 13:32:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-DATEADD/m-p/4293400#M170393</guid>
      <dc:creator>Rupak_bi</dc:creator>
      <dc:date>2024-11-20T13:32:00Z</dc:date>
    </item>
  </channel>
</rss>

