<?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: Contains vs Equals in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Contains-vs-Equals/m-p/4412356#M175237</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="884738" data-lia-user-login="brockry1" class="lia-mention lia-mention-user"&gt;brockry1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the following DAX formula instead if you want to determine whether the &lt;CODE&gt;Subject&lt;/CODE&gt; column contains the "Training" string or not:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# of completed events_Trainings =
CALCULATE (
    DISTINCTCOUNT ( 'Event &amp;amp; Task'[ID] ),
    'Event &amp;amp; Task'[Status (Consolidated)] = "Completed",
    CONTAINSSTRING ( 'Event &amp;amp; Task'[Subject], "Training" ) = TRUE
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;CONTAINSSTRING()&lt;/CODE&gt; function is case-insensitive. However, if you require a strictly case-sensitive check, use &lt;CODE&gt;CONTAINSSTRINGEXACT()&lt;/CODE&gt; instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can learn more about these functions here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/containsstring-function-dax" target="_self"&gt;CONTAINSSTRING()&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/containsstringexact-function-dax" target="_self"&gt;CONTAINSSTRINGEXACT()&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I have created small dataset of only 10 rows verify the, and here is the screenshot of it&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I am also attaching the sample Power BI file for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;BR /&gt;&lt;BR /&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;Accepting it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate your Kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="color: #033f38;"&gt;Proud to be a Super User&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Feb 2025 05:45:11 GMT</pubDate>
    <dc:creator>quantumudit</dc:creator>
    <dc:date>2025-02-16T05:45:11Z</dc:date>
    <item>
      <title>Contains vs Equals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Contains-vs-Equals/m-p/4412271#M175230</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have this measure to bring back the toatal traings from the subject column in the events and Tasks table.&amp;nbsp; I want it to show "Contains" vs equals at the end but im getting an error when trying.&amp;nbsp; How do I adjsut to get contains&amp;nbsp; trainings in the subject column?&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;# of completed events_Trainings =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Event &amp;amp; Task'&lt;/SPAN&gt;&lt;SPAN&gt;[ID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Event &amp;amp; Task'&lt;/SPAN&gt;&lt;SPAN&gt;[Status (Consolidated)]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Completed"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'Event &amp;amp; Task'&lt;/SPAN&gt;&lt;SPAN&gt;[Subject]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Training"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Feb 2025 22:23:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Contains-vs-Equals/m-p/4412271#M175230</guid>
      <dc:creator>brockry1</dc:creator>
      <dc:date>2025-02-15T22:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Contains vs Equals</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Contains-vs-Equals/m-p/4412356#M175237</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="884738" data-lia-user-login="brockry1" class="lia-mention lia-mention-user"&gt;brockry1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the following DAX formula instead if you want to determine whether the &lt;CODE&gt;Subject&lt;/CODE&gt; column contains the "Training" string or not:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# of completed events_Trainings =
CALCULATE (
    DISTINCTCOUNT ( 'Event &amp;amp; Task'[ID] ),
    'Event &amp;amp; Task'[Status (Consolidated)] = "Completed",
    CONTAINSSTRING ( 'Event &amp;amp; Task'[Subject], "Training" ) = TRUE
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;CONTAINSSTRING()&lt;/CODE&gt; function is case-insensitive. However, if you require a strictly case-sensitive check, use &lt;CODE&gt;CONTAINSSTRINGEXACT()&lt;/CODE&gt; instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can learn more about these functions here:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/containsstring-function-dax" target="_self"&gt;CONTAINSSTRING()&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/containsstringexact-function-dax" target="_self"&gt;CONTAINSSTRINGEXACT()&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I have created small dataset of only 10 rows verify the, and here is the screenshot of it&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I am also attaching the sample Power BI file for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;BR /&gt;&lt;BR /&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;Accepting it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate your Kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG style="color: #033f38;"&gt;Proud to be a Super User&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 05:45:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Contains-vs-Equals/m-p/4412356#M175237</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2025-02-16T05:45:11Z</dc:date>
    </item>
  </channel>
</rss>

