<?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 DAX Error - do not support comparing values of type Date with type Text in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3686411#M143196</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following table called 'In Out Dates' that looks something like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Driver Name&lt;/TD&gt;&lt;TD&gt;Driver Number&lt;/TD&gt;&lt;TD&gt;In Date&lt;/TD&gt;&lt;TD&gt;Out Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A B&lt;/TD&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;08 July 2023&lt;/TD&gt;&lt;TD&gt;04 August 2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A B&lt;/TD&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;08 September 2023&lt;/TD&gt;&lt;TD&gt;19 October 2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A B&lt;/TD&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;05 November 2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A W&lt;/TD&gt;&lt;TD&gt;222222&lt;/TD&gt;&lt;TD&gt;08 July 2023&lt;/TD&gt;&lt;TD&gt;24 August 2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A W&lt;/TD&gt;&lt;TD&gt;222222&lt;/TD&gt;&lt;TD&gt;08 October 2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A D&lt;/TD&gt;&lt;TD&gt;333333&lt;/TD&gt;&lt;TD&gt;08 July 2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DAX measure that is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;In Out Status = 
VAR TodayDate = [Today's Date]
VAR SelectedDriver = SELECTEDVALUE('Drivers List'[Driver Number])
VAR InDate = CALCULATE(MAX('In Out Dates'[In Date]), 'In Out Dates'[Driver Number]) = SelectedDriver
VAR OutDate = CALCULATE(MAX('In Out Dates'[Out Date]), 'In Out Dates'[Driver Number]) = SelectedDriver
RETURN
    IF(
        AND(
            TodayDate &amp;gt;= InDate,
            (OutDate = BLANK() || TodayDate &amp;lt; OutDate)
        ),
        "In",
        "Out"
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure must reference in In Out Dates table, take the driver number the user has selected in a slicer (SelectedDriver) and use this to get the latest date from the In Date column and the latest date from the Out Date column. If today's date is greater than or equal to the In Date and either the Out Date is null or today's date is less that the Out Date then the label In should be used, otherwise Out should be used.&amp;nbsp;&lt;BR /&gt;The Today's Date measure is simply -&amp;nbsp;&lt;BR /&gt;Today's Date = TODAY()&lt;BR /&gt;Running this however, I get an error in the visual and clicking on it it tells me 'Can't load the data for this visual - DAX comparison operations do not support comparing values of type Date with values of type Text'.&lt;/P&gt;&lt;P&gt;This is odd as the data types in the tables are set to date for In Date and Out Date columns and the Driver Number is text data type.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2024 17:23:51 GMT</pubDate>
    <dc:creator>julesdude7</dc:creator>
    <dc:date>2024-02-07T17:23:51Z</dc:date>
    <item>
      <title>DAX Error - do not support comparing values of type Date with type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3686411#M143196</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following table called 'In Out Dates' that looks something like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Driver Name&lt;/TD&gt;&lt;TD&gt;Driver Number&lt;/TD&gt;&lt;TD&gt;In Date&lt;/TD&gt;&lt;TD&gt;Out Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A B&lt;/TD&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;08 July 2023&lt;/TD&gt;&lt;TD&gt;04 August 2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A B&lt;/TD&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;08 September 2023&lt;/TD&gt;&lt;TD&gt;19 October 2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A B&lt;/TD&gt;&lt;TD&gt;111111&lt;/TD&gt;&lt;TD&gt;05 November 2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A W&lt;/TD&gt;&lt;TD&gt;222222&lt;/TD&gt;&lt;TD&gt;08 July 2023&lt;/TD&gt;&lt;TD&gt;24 August 2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A W&lt;/TD&gt;&lt;TD&gt;222222&lt;/TD&gt;&lt;TD&gt;08 October 2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A D&lt;/TD&gt;&lt;TD&gt;333333&lt;/TD&gt;&lt;TD&gt;08 July 2023&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DAX measure that is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;In Out Status = 
VAR TodayDate = [Today's Date]
VAR SelectedDriver = SELECTEDVALUE('Drivers List'[Driver Number])
VAR InDate = CALCULATE(MAX('In Out Dates'[In Date]), 'In Out Dates'[Driver Number]) = SelectedDriver
VAR OutDate = CALCULATE(MAX('In Out Dates'[Out Date]), 'In Out Dates'[Driver Number]) = SelectedDriver
RETURN
    IF(
        AND(
            TodayDate &amp;gt;= InDate,
            (OutDate = BLANK() || TodayDate &amp;lt; OutDate)
        ),
        "In",
        "Out"
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure must reference in In Out Dates table, take the driver number the user has selected in a slicer (SelectedDriver) and use this to get the latest date from the In Date column and the latest date from the Out Date column. If today's date is greater than or equal to the In Date and either the Out Date is null or today's date is less that the Out Date then the label In should be used, otherwise Out should be used.&amp;nbsp;&lt;BR /&gt;The Today's Date measure is simply -&amp;nbsp;&lt;BR /&gt;Today's Date = TODAY()&lt;BR /&gt;Running this however, I get an error in the visual and clicking on it it tells me 'Can't load the data for this visual - DAX comparison operations do not support comparing values of type Date with values of type Text'.&lt;/P&gt;&lt;P&gt;This is odd as the data types in the tables are set to date for In Date and Out Date columns and the Driver Number is text data type.&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 17:23:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3686411#M143196</guid>
      <dc:creator>julesdude7</dc:creator>
      <dc:date>2024-02-07T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error - do not support comparing values of type Date with type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3686984#M143226</link>
      <description>&lt;P&gt;Your measure can be simplified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 00:54:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3686984#M143226</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-08T00:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error - do not support comparing values of type Date with type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3693879#M143613</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;It doesn't quite give me what I want.&lt;BR /&gt;Based on the data in my orginal table above, if the current date is 24/08/2023, driver 222222 should have status as "Out" because the Out Date is 24/08/2023 and this would be the case until the next date - In Date of 08/10/2023.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 11:03:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3693879#M143613</guid>
      <dc:creator>julesdude7</dc:creator>
      <dc:date>2024-02-12T11:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Error - do not support comparing values of type Date with type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3694892#M143676</link>
      <description>&lt;LI-CODE lang="markup"&gt;if the current date is 24/08/2023&lt;/LI-CODE&gt;
&lt;P&gt;yeah, but that ship has sailed. Feels like your requirement is slightly different from what you describe?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 22:11:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Error-do-not-support-comparing-values-of-type-Date-with-type/m-p/3694892#M143676</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-12T22:11:25Z</dc:date>
    </item>
  </channel>
</rss>

