<?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: A year later in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2983403#M100053</link>
    <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;This may cause by date table include some invalid date value that can't be process with date function. You can try to add a ISERROR function to check these values before calculations:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DateTest =
IF (
    ISERROR ( DATEVALUE ( 'Date'[Date] &amp;amp; "" ) ),
    BLANK (),
    DATE ( YEAR ( 'Date'[Date] ) + 1, MONTH ( 'Date'[Date] ), DAY ( 'Date'[Date] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2022 05:17:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-22T05:17:10Z</dc:date>
    <item>
      <title>A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2970821#M99262</link>
      <description>&lt;P&gt;I&amp;nbsp; want to calculate when a year has passed. Tried this:&lt;/P&gt;&lt;P&gt;AYearLater = Date(Year([Start date]) + 1,&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month([Start date]),&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day([Start date]) )&lt;/P&gt;&lt;P&gt;But DAX says that I have an argument of the wrong data type or too large or too small. Presumably this is (Year([Start date]) + 1) as replacing that with a number or with Year([Start date]) is fine.&lt;/P&gt;&lt;P&gt;So I tried&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AYearLater = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt;&lt;SPAN&gt; YearOn = &lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;([Start date]) + &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Date&lt;/SPAN&gt;&lt;SPAN&gt;(YearOn, &lt;/SPAN&gt;&lt;SPAN&gt;Month&lt;/SPAN&gt;&lt;SPAN&gt;([Start date]), &lt;/SPAN&gt;&lt;SPAN&gt;Day&lt;/SPAN&gt;&lt;SPAN&gt;([Start date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And that's no better.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AYearOn = Year(Start date) + 1 returns a perfectly ordinary integer.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I tried (Int(Year([Start date]) + 1) : no good.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I realise I could use Edate([Start date], 12) but I don't see why DAX objects to my original attempt.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Dec 2022 13:02:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2970821#M99262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-15T13:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2970853#M99265</link>
      <description>&lt;P&gt;I tried your syntax (below) in a calculated column and it worked fine. Just confirming you are talking about a calculated column, and that [Start date] is not a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DateTest = &lt;/SPAN&gt;&lt;SPAN&gt;DATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;YEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)+&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Month&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Pat&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Dec 2022 13:21:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2970853#M99265</guid>
      <dc:creator>ppm1</dc:creator>
      <dc:date>2022-12-15T13:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2970861#M99267</link>
      <description>&lt;P&gt;Yes, a calculated column&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 13:24:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2970861#M99267</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-15T13:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2975996#M99637</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi Anonymous&lt;/LI-USER&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If these also don't help, please share more detailed information to help us clarify your scenario to test.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 07:52:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2975996#M99637</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-19T07:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2976943#M99690</link>
      <description>&lt;P&gt;I'm afraid not. I thought I'd answered the question ppm1 asked me. It seems the code works for ppm1 but not for me. I have no idea why this should be, or what else to tell you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PBI could be a bit more helpful about its DAX complaints. "an argument of the wrong data type or too large or too small" doesn't tell me where to look. Which argument? The interpreter must know. However changing the Year argument to remove any calculations removed the error so that tells me where to look. That doesn't explain why [Field] is an acceptable value but [Field]+1 is not.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 15:05:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2976943#M99690</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-19T15:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2983403#M100053</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;This may cause by date table include some invalid date value that can't be process with date function. You can try to add a ISERROR function to check these values before calculations:&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DateTest =
IF (
    ISERROR ( DATEVALUE ( 'Date'[Date] &amp;amp; "" ) ),
    BLANK (),
    DATE ( YEAR ( 'Date'[Date] ) + 1, MONTH ( 'Date'[Date] ), DAY ( 'Date'[Date] ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 05:17:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2983403#M100053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-22T05:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: A year later</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2998405#M101126</link>
      <description>&lt;P&gt;That is helpful, thank you. There was a blank in the Start date column.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 11:22:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/A-year-later/m-p/2998405#M101126</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-03T11:22:35Z</dc:date>
    </item>
  </channel>
</rss>

