<?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: Comparing two dates when one field is text and the other a date in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410571#M12242</link>
    <description>&lt;P&gt;My bad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;PRE&gt;IF(Or(not((opened_date)=(closed_date)), IsBlank(closed_date)),0,1)&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Fri, 04 May 2018 07:47:23 GMT</pubDate>
    <dc:creator>v-micsh-msft</dc:creator>
    <dc:date>2018-05-04T07:47:23Z</dc:date>
    <item>
      <title>Comparing two dates when one field is text and the other a date</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410139#M12228</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping someone can help. In my data I've got two different fields. An opened date and a closed date. My opened date always contains an date so the format is date. The closed date doesn't always contain a closed date so may sometimes contain "NULL".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This field is then formatted as text and when I try to work out the difference between the 2 dates I get an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As this is the way the dat pulls through from the source data I'd ideally not like to have to replace blanks etc.. within PowerBI but put it in the formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write =IF(opened_date)=(closed_date),1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 16:51:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410139#M12228</guid>
      <dc:creator>Dan27</dc:creator>
      <dc:date>2018-05-03T16:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two dates when one field is text and the other a date</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410347#M12234</link>
      <description>&lt;P&gt;For the NUll, we have a function &lt;A href="https://msdn.microsoft.com/en-us/query-bi/dax/isblank-function-dax" target="_self"&gt;IsBlank()&lt;/A&gt; could be used.&lt;/P&gt;&lt;P&gt;You could first check if the closed date is blank first.&lt;/P&gt;&lt;P&gt;The formula should be changed as below:&lt;/P&gt;&lt;PRE&gt;IF(Or(!(opened_date)=(closed_date), IsBlank(closed_date)),0,1)&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 01:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410347#M12234</guid>
      <dc:creator>v-micsh-msft</dc:creator>
      <dc:date>2018-05-04T01:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two dates when one field is text and the other a date</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410555#M12240</link>
      <description>&lt;P&gt;Thanks Michael, however when I try this I still get the error below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The syntax for '!' is incorrect. (DAX(IF(Or(!(opened_date)=(closed_date), IsBlank(closed_date)),0,1))).&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 07:28:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410555#M12240</guid>
      <dc:creator>Dan27</dc:creator>
      <dc:date>2018-05-04T07:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two dates when one field is text and the other a date</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410571#M12242</link>
      <description>&lt;P&gt;My bad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;PRE&gt;IF(Or(not((opened_date)=(closed_date)), IsBlank(closed_date)),0,1)&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 07:47:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410571#M12242</guid>
      <dc:creator>v-micsh-msft</dc:creator>
      <dc:date>2018-05-04T07:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing two dates when one field is text and the other a date</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410575#M12243</link>
      <description>&lt;P&gt;Thanks Michael. That cleared that error but I still get the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2018 07:53:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Comparing-two-dates-when-one-field-is-text-and-the-other-a-date/m-p/410575#M12243</guid>
      <dc:creator>Dan27</dc:creator>
      <dc:date>2018-05-04T07:53:30Z</dc:date>
    </item>
  </channel>
</rss>

