<?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: &amp;quot;Contains Number&amp;quot; with DAX Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4160042#M165303</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Since 'lead'[Product selection] is a text column, the original formula using Search should work for numbers, as Search is designed to handle text strings, including numeric strings within text. However, if the formula isn't working as expected, it's possible that other issues, such as extra spaces or unexpected characters in the text, might be affecting the search.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To confirm if the issue lies with formatting or the presence of extra characters, you could try using TRIM to remove any leading or trailing spaces, or alternatively, Containsstring, which might handle the search more intuitively for your case.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here’s a more direct version using Containsstring for simplicity:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count product_selection Test Multiple Choice =
CALCULATE(
    COUNT('lead'[Product selection]),
    CONTAINSSTRING('lead'[Product selection], "894910000")
)
&lt;/LI-CODE&gt;
&lt;P&gt;This should work effectively for numeric strings within text columns. Let me know if this resolves the issue!&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 14:37:50 GMT</pubDate>
    <dc:creator>DataNinja777</dc:creator>
    <dc:date>2024-09-19T14:37:50Z</dc:date>
    <item>
      <title>"Contains Number" with DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4160010#M165298</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to count all fields that contain a specific product number, in this case&amp;nbsp;&lt;SPAN&gt;894910000 (then I would create further measures for the other products, containing 894910001,&amp;nbsp;894910002, etc.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;This is the table:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;So the output should be: 534+105+68+1+270+1+1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created the following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Count product_selection Test Multiple Choice =&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;('lead'[Product selection]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SEARCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"894910000"&lt;/SPAN&gt;&lt;SPAN&gt;, 'lead'[Product selection], &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I used the above measure to search for "text" before and it worked, but maybe it does not work for numbers?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Sep 2024 14:23:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4160010#M165298</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-09-19T14:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: "Contains Number" with DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4160042#M165303</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Since 'lead'[Product selection] is a text column, the original formula using Search should work for numbers, as Search is designed to handle text strings, including numeric strings within text. However, if the formula isn't working as expected, it's possible that other issues, such as extra spaces or unexpected characters in the text, might be affecting the search.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To confirm if the issue lies with formatting or the presence of extra characters, you could try using TRIM to remove any leading or trailing spaces, or alternatively, Containsstring, which might handle the search more intuitively for your case.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here’s a more direct version using Containsstring for simplicity:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count product_selection Test Multiple Choice =
CALCULATE(
    COUNT('lead'[Product selection]),
    CONTAINSSTRING('lead'[Product selection], "894910000")
)
&lt;/LI-CODE&gt;
&lt;P&gt;This should work effectively for numeric strings within text columns. Let me know if this resolves the issue!&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 14:37:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4160042#M165303</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-09-19T14:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: "Contains Number" with DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4161632#M165343</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats really strange... actually I get the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"The data for this visualization was not found.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;OLE DB or ODBC error: [Expression.Error] The expression could not be folded for the data source. Try a simpler expression."&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2024 07:32:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4161632#M165343</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-09-20T07:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: "Contains Number" with DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4161705#M165346</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755889" data-lia-user-login="cn4422" class="lia-mention lia-mention-user"&gt;cn4422&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much DataNinja777&amp;nbsp;for your prompt reply.&amp;nbsp;Allow me to add something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I conducted a test for the question you raised.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It turns out that both SEARCH and CONTAINSSTRING work with text and numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“NUMBER lead”&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“TEXT lead”&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;
&lt;P&gt;However, &lt;STRONG&gt;please note&lt;/STRONG&gt; that in the screenshot you provide, if you change the data type to a number because the data is too large, scientific notation is used. This can have an impact on your measure results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“lead”&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, I recommend that you use&lt;STRONG&gt; text-type&lt;/STRONG&gt; data for your calculations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2024 08:02:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4161705#M165346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-20T08:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: "Contains Number" with DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4173461#M165745</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again guys for your effort!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It just didn't work for me in this case but it wouldn't get into my mind why it wouldn't work, because your solutions were absolutely logical.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried lots of things and finally got it working with basically your formula plus adding an "&lt;FONT color="#FF0000"&gt;*&lt;/FONT&gt;"-sign at the end of the string...&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count product_selection Test Contain Multiple Choice = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;('lead'[Product selection]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CONTAINSSTRING&lt;/SPAN&gt;&lt;SPAN&gt;('lead'[Product selection], &lt;/SPAN&gt;&lt;SPAN&gt;"894910000&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;*&lt;/FONT&gt;&lt;/STRONG&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 08:30:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/quot-Contains-Number-quot-with-DAX-Measure/m-p/4173461#M165745</guid>
      <dc:creator>cn4422</dc:creator>
      <dc:date>2024-09-25T08:30:33Z</dc:date>
    </item>
  </channel>
</rss>

