<?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 Days between dates with nulls and blanks in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1699398#M34996</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have a table with three columns:&amp;nbsp; Seniority date, Hire date and data date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to calculate the days/years between Seniority date and data date, however, the Seniority date column contains blanks and nulls along with actual dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a given line contains either a blank or null for seniority date, then I want to look at Hire date and apply the same logic.&amp;nbsp; If Hire date contains a blank or null, then return a blank in the field for SenYrs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below attempt at the code says there are no syntax errors but I get an error at runtime stating "The name 'isblank' wasn't recognized'.&amp;nbsp; Any help or ideas would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(not(isblank[Seniority Date])) or&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Seniority Date]&amp;lt;&amp;gt;null then&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ([data date]-[Seniority Date])/365.25&lt;/P&gt;&lt;P&gt;else&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if(not(isblank[Hire Date])) or&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Hire Date]&amp;lt;&amp;gt;null then&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ([data date]-[Hire Date])/365.25&lt;/P&gt;&lt;P&gt;else&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;blank()&lt;/P&gt;</description>
    <pubDate>Tue, 02 Mar 2021 22:09:40 GMT</pubDate>
    <dc:creator>DjDon</dc:creator>
    <dc:date>2021-03-02T22:09:40Z</dc:date>
    <item>
      <title>Days between dates with nulls and blanks</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1699398#M34996</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have a table with three columns:&amp;nbsp; Seniority date, Hire date and data date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to calculate the days/years between Seniority date and data date, however, the Seniority date column contains blanks and nulls along with actual dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a given line contains either a blank or null for seniority date, then I want to look at Hire date and apply the same logic.&amp;nbsp; If Hire date contains a blank or null, then return a blank in the field for SenYrs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below attempt at the code says there are no syntax errors but I get an error at runtime stating "The name 'isblank' wasn't recognized'.&amp;nbsp; Any help or ideas would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if(not(isblank[Seniority Date])) or&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Seniority Date]&amp;lt;&amp;gt;null then&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ([data date]-[Seniority Date])/365.25&lt;/P&gt;&lt;P&gt;else&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;if(not(isblank[Hire Date])) or&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Hire Date]&amp;lt;&amp;gt;null then&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ([data date]-[Hire Date])/365.25&lt;/P&gt;&lt;P&gt;else&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;blank()&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 22:09:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1699398#M34996</guid>
      <dc:creator>DjDon</dc:creator>
      <dc:date>2021-03-02T22:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Days between dates with nulls and blanks</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1699974#M34998</link>
      <description>&lt;P&gt;your missing a bracket&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if(not(isblank&amp;nbsp; &lt;STRONG&gt;(&amp;nbsp;&lt;/STRONG&gt; [Seniority Date])) or&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 06:42:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1699974#M34998</guid>
      <dc:creator>rfigtree</dc:creator>
      <dc:date>2021-03-03T06:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Days between dates with nulls and blanks</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1701161#M35026</link>
      <description>&lt;P&gt;Appreciate the response, however, I still get the same error.&amp;nbsp; I did try to rewrite the code but now am getting a "Token Then expected" error ar runtime:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if [Seniority Date] &amp;lt;&amp;gt; null || [Seniority Date] &amp;lt;&amp;gt; ""&lt;BR /&gt;then&lt;BR /&gt;([data date]-[Seniority Date])/365.25&lt;BR /&gt;else if [Hire Date] &amp;lt;&amp;gt; null || [Hire Date] &amp;lt;&amp;gt; ""&lt;BR /&gt;then&lt;BR /&gt;([data date]-[Hire Date])/365.25&lt;BR /&gt;else&lt;BR /&gt;blank()&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 14:10:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Days-between-dates-with-nulls-and-blanks/m-p/1701161#M35026</guid>
      <dc:creator>DjDon</dc:creator>
      <dc:date>2021-03-03T14:10:51Z</dc:date>
    </item>
  </channel>
</rss>

