<?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: Counting multiple values within a single cell for different results in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932184#M96489</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion, it seems to work mostly. Can I add more filter expressions to this? So that I can filter tickets not only by "CV" but also additional expressions like "VW N".&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2022 08:01:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-11-28T08:01:36Z</dc:date>
    <item>
      <title>Counting multiple values within a single cell for different results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2930539#M96395</link>
      <description>&lt;P&gt;I have a solution to a problem that I have but am not able to write it in DAX, in Excel this would mainly include COUNTIF(.&lt;BR /&gt;I need to check a cell content to see if it contains a specific word 2 times, and if yes then I get a result, if not then go into another check.&lt;/P&gt;&lt;P&gt;Here is a similar example I could think of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I want to check the title for VW, but give the output "VW" ONLY for TITLES that contain VW, not VW CV.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;TITLES can contain both VW and VW CV, or none of both.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;TITLE&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;WANTED RESULT&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test text VW and more text with VW CV&lt;/TD&gt;&lt;TD&gt;VW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test text VW and nothing else&lt;/TD&gt;&lt;TD&gt;VW&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test text that only has VW CV&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Test text with nothing here&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My idea was to use a COUNTIF( function to see how many "VW" are in the title, if it is 2, then the WANTED RESULT should be VW as both will be in the TITLE.&lt;/P&gt;&lt;P&gt;If the COUNTIF( result is 1, then check to see if that title has "VW CV", if yes then the WANTED RESULT should be 0, otherwise 1 as it has to be "VW".&lt;/P&gt;&lt;P&gt;If the COUNTIF( result is 0, then the WANTED RESULT should be 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If someone could put this in DAX form that would be awesome!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 26 Nov 2022 10:25:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2930539#M96395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-26T10:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Counting multiple values within a single cell for different results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2930832#M96416</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer to attached sample file with the solution&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;RESULT = 
VAR String = 'Table'[TITLE]
VAR Items = SUBSTITUTE ( String, " ", "|" )
VAR Length = COALESCE ( PATHLENGTH ( Items ), 1 )
VAR T1 = GENERATESERIES ( 1, Length, 1 )
VAR T2 = SELECTCOLUMNS ( T1, "@Item", PATHITEM ( Items, [Value] ) )
VAR Check1 = COUNTROWS ( FILTER ( T2, [@Item] = "VW" ) )
VAR Check2 = COUNTROWS ( FILTER ( T2, [@Item] = "CV" ) )
VAR Result =
    SWITCH ( 
        TRUE ( ),
        Check1 = 0, "0",
        Check1 &amp;gt; 1, "VW",
        Check2 &amp;gt;= 1, "0",
        "VW"
    )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 26 Nov 2022 20:46:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2930832#M96416</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-26T20:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Counting multiple values within a single cell for different results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932184#M96489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion, it seems to work mostly. Can I add more filter expressions to this? So that I can filter tickets not only by "CV" but also additional expressions like "VW N".&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 08:01:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932184#M96489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-28T08:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Counting multiple values within a single cell for different results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932217#M96492</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;If I correctly understand, then you may change the valriable "Check2"&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;VAR Check2 = COUNTROWS ( FILTER ( T2, [@Item] IN { "CV", "N" } ) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 08:14:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932217#M96492</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-11-28T08:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Counting multiple values within a single cell for different results</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932233#M96496</link>
      <description>&lt;P&gt;You sir are a lifesaver!&lt;BR /&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 08:18:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-multiple-values-within-a-single-cell-for-different/m-p/2932233#M96496</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-28T08:18:05Z</dc:date>
    </item>
  </channel>
</rss>

