<?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: DAX Function To Compare 3 Different Dates-Timestamps Columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792594#M4597</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp; yes we did and the formula worked fine but as per my last message, the output result did not look right as it was heavily skewed based on over 72k rows of data. I attached full dataset in my last message and just curious if you were able to replicate it from your end. But if not possible, then its ok. Sorry for the trouble. Appreciate your help thus far.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Sep 2019 12:33:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-15T12:33:08Z</dc:date>
    <item>
      <title>DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789203#M4443</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am using Powerpivot and I have 3 columns, each with date &amp;amp; time scans in them. The 3 columns occur in the exact sequence as shown below: (i.e. Job booking date occurs first, then Attempted Acceptance Date, then Acceptance Date)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Job Booking Date&lt;/LI&gt;&lt;LI&gt;Attempted Acceptance Date&lt;/LI&gt;&lt;LI&gt;Acceptance Date&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I have a calculated column called &lt;STRONG&gt;BEFORE 12 SCAN&lt;/STRONG&gt; and I need a function to determine the following logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if Job Booking Date &amp;lt; 12:00 midday, AND Attempted Acceptance Date &amp;lt; 12:00 midday (on the same day) AND Acceptance Date &amp;lt; 12:00 midday (on the same day), then output "YES", else "NO" in BEFORE 12 SCAN column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; Job booking has &lt;STRONG&gt;NO&lt;/STRONG&gt; blank cells but Attempted Acceptance Date and Acceptance Date may have blank cells.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate any help:)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 09:24:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789203#M4443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-11T09:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789228#M4446</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;PRE&gt;NewCol =&amp;nbsp;
VAR Time1_ = HOUR(Table1[Job Booking Date])
VAR Time2_ = HOUR(Table1[Attempted Acceptance Date])
VAR Time3_ = HOUR(Table1[Acceptance Date])
VAR Date1_ = INT(Table1[Job Booking Date])
VAR Date2_ = INT(Table1[Attempted Acceptance Date])
VAR Date3_ = INT(Table1[Acceptance Date])
VAR SameDate_ = (Date1_ = Date2_) &amp;amp;&amp;amp;&amp;nbsp;&amp;nbsp;(Date2_ = Date3_)
RETURN
IF( SameDate_ &amp;amp;&amp;amp; Time1_ &amp;lt; 12 &amp;amp;&amp;amp; Time2_ &amp;lt; 12&amp;nbsp; &amp;amp;&amp;amp; Time3_ &amp;lt; 12, "Yes", "No")&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 09:38:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789228#M4446</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-09-11T09:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789239#M4448</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp; thank you for the quick reply. FYI am using powerpivot in Excel. Your formula structure/syntax looks different, will it still work or do I have to modify it before applying it??&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 09:44:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789239#M4448</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-11T09:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789290#M4452</link>
      <description>&lt;P&gt;Should be the same. The DAX engine is the same in both cases&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 10:31:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789290#M4452</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-09-11T10:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789348#M4458</link>
      <description>&lt;P&gt;I pasted formula and replaced Table 1 with my table name but I get the following error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"Failed to resolve name 'NewCol' it is not a valid table, variable or function name"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I'm a bit of a newbie and still learning....&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 11:35:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789348#M4458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-11T11:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789541#M4467</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NewCol is the name of the new column. The DAX code for the column is the rest so enter everything without the "NewCol ="&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(or maybe with the = at the beginning, I don't remember if it's included by default in Power Pivto when you define a calculated column)&lt;/P&gt;
&lt;PRE&gt;VAR Time1_ = HOUR(Table1[Job Booking Date])
VAR Time2_ = HOUR(Table1[Attempted Acceptance Date])
VAR Time3_ = HOUR(Table1[Acceptance Date])
VAR Date1_ = INT(Table1[Job Booking Date])
VAR Date2_ = INT(Table1[Attempted Acceptance Date])
VAR Date3_ = INT(Table1[Acceptance Date])
VAR SameDate_ = (Date1_ = Date2_) &amp;amp;&amp;amp;  (Date2_ = Date3_)
RETURN
IF( SameDate_ &amp;amp;&amp;amp; Time1_ &amp;lt; 12 &amp;amp;&amp;amp; Time2_ &amp;lt; 12  &amp;amp;&amp;amp; Time3_ &amp;lt; 12, "Yes", "No")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 14:24:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789541#M4467</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-09-11T14:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789857#M4483</link>
      <description>&lt;P&gt;Yes that worked and powerpivot does include = at beginning by default.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry its my first time seeing such a long formula and didn't know you could include variables in a formula which is awesome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help, much appreciated:)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 20:14:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789857#M4483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-11T20:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789937#M4487</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;sorry to bug you again but I misinterpreted my logic. The &lt;STRONG&gt;correct logic&lt;/STRONG&gt; should be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if Job Booking DateTime &amp;lt; 12 midday AND Attempted Acceptance Scan DateTime &amp;amp;&amp;amp; Acceptance DateTime occur on the &lt;STRONG&gt;SAME DAY&lt;/STRONG&gt; as Job Booking DateTime, then output "YES", else "NO"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your formula below fyi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR Time1_ = HOUR(FF_August_Dataset[JOB_BOOKING_DATETIME])&lt;BR /&gt;VAR Time2_ = HOUR(FF_August_Dataset[ATTEMPTED_ACCEPTANCE_DATETIME])&lt;BR /&gt;VAR Time3_ = HOUR(FF_August_Dataset[ACCEPTANCE_DATETIME])&lt;BR /&gt;VAR Date1_ = INT(FF_August_Dataset[JOB_BOOKING_DATETIME])&lt;BR /&gt;VAR Date2_ = INT(FF_August_Dataset[ATTEMPTED_ACCEPTANCE_DATETIME])&lt;BR /&gt;VAR Date3_ = INT(FF_August_Dataset[ACCEPTANCE_DATETIME])&lt;BR /&gt;VAR SameDate_ = (Date1_ = Date2_) &amp;amp;&amp;amp; (Date2_ = Date3_)&lt;BR /&gt;RETURN&lt;BR /&gt;IF( SameDate_ &amp;amp;&amp;amp; Time1_ &amp;lt; 12 &amp;amp;&amp;amp; Time2_ &amp;lt; 12 &amp;amp;&amp;amp; Time3_ &amp;lt; 12, "Yes", "No")&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 00:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/789937#M4487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-12T00:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792564#M4594</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;sorry to bug you again but just wanting to follow up on this issue when you have time please. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2019 07:19:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792564#M4594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-15T07:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792587#M4596</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hadn't we looked&amp;nbsp;at this already? If I understand correctly what you are after, you can just drop two of the conditions and their variables:&lt;/P&gt;
&lt;PRE&gt;VAR Time1_ = HOUR(Table1[Job Booking Date])
VAR Date1_ = INT(Table1[Job Booking Date])
VAR Date2_ = INT(Table1[Attempted Acceptance Date])
VAR Date3_ = INT(Table1[Acceptance Date])
VAR SameDate_ = (Date1_ = Date2_) &amp;amp;&amp;amp;  (Date2_ = Date3_)
RETURN
IF( SameDate_ &amp;amp;&amp;amp; Time1_ &amp;lt; 12 , "Yes", "No")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider giving kudos if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2019 11:18:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792587#M4596</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-09-15T11:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792594#M4597</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp; yes we did and the formula worked fine but as per my last message, the output result did not look right as it was heavily skewed based on over 72k rows of data. I attached full dataset in my last message and just curious if you were able to replicate it from your end. But if not possible, then its ok. Sorry for the trouble. Appreciate your help thus far.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2019 12:33:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/792594#M4597</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-15T12:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/793013#M4607</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll try to have a look later on. Where is the dataset? Has the post been deleted?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 08:14:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/793013#M4607</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-09-16T08:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Function To Compare 3 Different Dates-Timestamps Columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/793693#M4631</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp; its ok I've managed to fix issue myself after some manual testing. Thanks again:)&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 22:09:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Function-To-Compare-3-Different-Dates-Timestamps-Columns/m-p/793693#M4631</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-16T22:09:01Z</dc:date>
    </item>
  </channel>
</rss>

