<?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: How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861031#M185422</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can use EDATE on the LASTDATE to achieve this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/edate-function-dax" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/edate-function-dax&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2025 20:52:18 GMT</pubDate>
    <dc:creator>djurecic</dc:creator>
    <dc:date>2025-10-28T20:52:18Z</dc:date>
    <item>
      <title>How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861023#M185421</link>
      <description>&lt;P&gt;I have following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ForecastMonths =&lt;/SPAN&gt; &lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;FIRSTDATE&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Survey Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;LASTDATE&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;SPAN&gt;[Month Year]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;MONTH&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am trying to adjust the result (which comes in number of month) to one more/less month.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like the result to be either 91 or 89.&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How do I go about doing it?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks for help.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 21:10:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861023#M185421</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-10-28T21:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861031#M185422</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can use EDATE on the LASTDATE to achieve this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/edate-function-dax" target="_blank"&gt;https://learn.microsoft.com/en-us/dax/edate-function-dax&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:52:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861031#M185422</guid>
      <dc:creator>djurecic</dc:creator>
      <dc:date>2025-10-28T20:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861032#M185423</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;not sure what you are trying to achieve, when you add or subtract:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ForecastMonths = DATEDIFF(
                                                FIRSTDATE ('Table'[Survey Date]),
                                                LASTDATE ('Calendar'[Month Year]),
                                                MONTH
                                              ) + 1 // or -1&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Oct 2025 20:52:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861032#M185423</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2025-10-28T20:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861049#M185425</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;Thank you and sorry.&lt;/P&gt;&lt;P&gt;I guess I need to use&amp;nbsp; -1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I ask you one more question?&lt;/P&gt;&lt;P&gt;How can I wrap so that this condition only applies if value is 0 or greater than 0 so that there is no -1?&lt;/P&gt;&lt;P&gt;I guess I am trying to use IF statement for the result..&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 21:13:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861049#M185425</guid>
      <dc:creator>JustinDoh1</dc:creator>
      <dc:date>2025-10-28T21:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861060#M185426</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;sure here it is, change the condition as per your needs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ForecastMonths = 
VAR __Months = 
DATEDIFF(
    FIRSTDATE ('Table'[Survey Date]),
    LASTDATE ('Calendar'[Month Year]),
    MONTH
)
RETURN
IF ( __Months &amp;gt;= 0, __Months - 1, __Months )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2025 22:02:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861060#M185426</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2025-10-28T22:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861505#M185439</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="296339" data-lia-user-login="JustinDoh1" class="lia-mention lia-mention-user"&gt;JustinDoh1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ForecastMonths =&lt;BR /&gt;VAR Diff = DATEDIFF(&lt;BR /&gt;FIRSTDATE('Table'[Survey Date]),&lt;BR /&gt;LASTDATE('Calendar'[Month Year]),&lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(Diff &amp;gt;= 0, Diff - 1, Diff)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this answer helped, please click Kudos or mark as Solution.&lt;BR /&gt;-Kedar&lt;BR /&gt;LinkedIn: &lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank"&gt;https://www.linkedin.com/in/kedar-pande&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 10:27:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-subtract-one-more-month-to-DATEDIFF-result-only-if-total/m-p/4861505#M185439</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2025-10-29T10:27:24Z</dc:date>
    </item>
  </channel>
</rss>

