<?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: Not recognizing &amp;quot;22-23&amp;quot; as text in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4253247#M168471</link>
    <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799617" data-lia-user-login="MindfullyLost" class="lia-mention lia-mention-user"&gt;MindfullyLost&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am not sure but the DAX looks fine.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, if all rows in 'school_year' column have "-", then surely all rows will return 1 as you mentioned. This means that the DAX is working properly.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2024 00:34:27 GMT</pubDate>
    <dc:creator>Irwan</dc:creator>
    <dc:date>2024-10-23T00:34:27Z</dc:date>
    <item>
      <title>Not recognizing "22-23" as text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4253180#M168464</link>
      <description>&lt;P&gt;I'm trying to create a column based on the value of [school_year] but it isn't reading the values correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each of these DAX returns all 0 despite "22-23" clearly existing.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;behavior_flag = 
IF(
    [school_year] = "22-23",
    1, 
    0
)

behavior_flag = 
IF(
    TRIM([school_year]) = "22-23",
    1, 
    0
)

behavior_flag = 
IF(
    CONTAINSSTRING([school_year], "22"), 
    1,
    0
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this returns all 1's:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;behavior_flag = 
IF(
    CONTAINSSTRING([school_year], "-"),
    1,
    0
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also am including a screenshot for how I confirmed that it is indeed a Text column.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 22:04:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4253180#M168464</guid>
      <dc:creator>MindfullyLost</dc:creator>
      <dc:date>2024-10-22T22:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Not recognizing "22-23" as text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4253247#M168471</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799617" data-lia-user-login="MindfullyLost" class="lia-mention lia-mention-user"&gt;MindfullyLost&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am not sure but the DAX looks fine.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, if all rows in 'school_year' column have "-", then surely all rows will return 1 as you mentioned. This means that the DAX is working properly.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 00:34:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4253247#M168471</guid>
      <dc:creator>Irwan</dc:creator>
      <dc:date>2024-10-23T00:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not recognizing "22-23" as text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4254467#M168530</link>
      <description>&lt;P&gt;I'm sorry, I should have been more clear about the issue. I have values "23-24" and "24-25" throughout the dataset. Therefore, searching for a "-" does indeed work properly in that it returns all rows. The issue is that it cannot find "23-24" as evidenced by the fact that it returns all 0's.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2024 13:32:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4254467#M168530</guid>
      <dc:creator>MindfullyLost</dc:creator>
      <dc:date>2024-10-23T13:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Not recognizing "22-23" as text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4255669#M168583</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="799617" data-lia-user-login="MindfullyLost" class="lia-mention lia-mention-user"&gt;MindfullyLost&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all thanks to&amp;nbsp;Irwan&amp;nbsp; for the quick reply. I have some other thoughts to add:&lt;BR /&gt;It works fine through my tests.&lt;BR /&gt;1. you can use LEN() function to check if the number of characters is 5 or not.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = LEN('Table'[school_year])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;2. you can check the output by following the DAX formula using the CONTAINSSTRING() function instead of the equal sign.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;behavior_flag_2 = 
IF(
    CONTAINSSTRING([school_year], "22-23"), 
    1,
    0
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3.Try updating PBI Desktop to the latest version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;&lt;EM&gt;helps&lt;/EM&gt;&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>Thu, 24 Oct 2024 06:44:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Not-recognizing-quot-22-23-quot-as-text/m-p/4255669#M168583</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-24T06:44:55Z</dc:date>
    </item>
  </channel>
</rss>

