<?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 Data Type Comparison in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3487551#M133452</link>
    <description>&lt;LI-CODE lang="markup"&gt;wk_col_FILTER = 

VAR dtToday = TODAY()
VAR dt2wk = TODAY() - 14
VAR dt4wk = TODAY() - 28
VAR dt26wk = TODAY() - 182
VAR dt52wk = TODAY() - 364
VAR dt1yrplus = MIN('OTIF - OPD'[Original Promise Date])

RETURN

IF('OTIF - OPD'[Original Promise Date] &amp;lt;= dtToday &amp;gt;= dt4wk , "2wk" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code (i will add the other variables at the end) but wanted to fix this first! so using this i get the "DAX comparison operations do not support comparing values of type True/False with values of type Date. Consider using the VALUE or FORMAT function to convert one of the values." error. How can i fix this? ive used values and INT but must be doing something wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;And how can i use switch in this? thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2023 11:31:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-20T11:31:03Z</dc:date>
    <item>
      <title>Data Type Comparison</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3487551#M133452</link>
      <description>&lt;LI-CODE lang="markup"&gt;wk_col_FILTER = 

VAR dtToday = TODAY()
VAR dt2wk = TODAY() - 14
VAR dt4wk = TODAY() - 28
VAR dt26wk = TODAY() - 182
VAR dt52wk = TODAY() - 364
VAR dt1yrplus = MIN('OTIF - OPD'[Original Promise Date])

RETURN

IF('OTIF - OPD'[Original Promise Date] &amp;lt;= dtToday &amp;gt;= dt4wk , "2wk" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code (i will add the other variables at the end) but wanted to fix this first! so using this i get the "DAX comparison operations do not support comparing values of type True/False with values of type Date. Consider using the VALUE or FORMAT function to convert one of the values." error. How can i fix this? ive used values and INT but must be doing something wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;And how can i use switch in this? thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 11:31:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3487551#M133452</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-20T11:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data Type Comparison</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3487590#M133454</link>
      <description>&lt;P&gt;hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use convert function like below&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;wk_col_FILTER = 

VAR dtToday = TODAY()
VAR dt2wk = convert(TODAY() - 14,datetime)
VAR dt4wk = convert(TODAY() - 28,datetime)
VAR dt26wk = convert(TODAY() - 182,datetime)
VAR dt52wk = convert(TODAY() - 364,datetime)
VAR dt1yrplus = MIN('OTIF - OPD'[Original Promise Date])

RETURN

IF('OTIF - OPD'[Original Promise Date] &amp;lt;= dtToday &amp;gt;= dt4wk , "2wk" )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 Oct 2023 11:46:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3487590#M133454</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-10-20T11:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Data Type Comparison</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3490496#M133633</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Update your dax.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;wk_col_FILTER = 

VAR dtToday = TODAY()
VAR dt2wk = TODAY() - 14
VAR dt4wk = TODAY() - 28
VAR dt26wk = TODAY() - 182
VAR dt52wk = TODAY() - 364
VAR dt1yrplus = MIN('OTIF - OPD'[Original Promise Date])

RETURN

IF('OTIF - OPD'[Original Promise Date] &amp;lt;= dtToday &amp;amp;&amp;amp; 'OTIF - OPD'[Original Promise Date] &amp;gt;= dt4wk , "2wk" )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 06:23:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Data-Type-Comparison/m-p/3490496#M133633</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T06:23:02Z</dc:date>
    </item>
  </channel>
</rss>

