<?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: Error with COUNTROWS() not finding the right FIND() text in a table. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1400805#M25778</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; That was just to replace the MAXX that you had in your formula. You can remove it if you don't need it.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 03:41:07 GMT</pubDate>
    <dc:creator>AntrikshSharma</dc:creator>
    <dc:date>2020-09-29T03:41:07Z</dc:date>
    <item>
      <title>Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1397729#M25690</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find the amount of times a text appears in a table. I have a column = "Volume" from a table 'Table'. I want to see if volume is greater than or less than its 62 day standard deviation. If it is, make a column called 'Alert' with a phrase, if volume is not outside these bounds, the cell will be blank. Like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So I have an alert:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Alert_V% = 
    IF(
        [% Share Volume] &amp;gt; [YMax V%], "Share Volume: &amp;gt; 1.5 Std Dev", 
    IF(
        [% Share Volume] &amp;lt; [YMin V%], "Share Volume: &amp;lt; 1.5 Std Dev", BLANK()
    ))&lt;/LI-CODE&gt;&lt;P&gt;and I want to essentially take this table, and count the number of times "Share Volume" appears and count those rows.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Alert Sum_V% = 
Var _session_date = MAXX(
    ALL('Verizon Call Reason'),'Verizon Call Reason'[session_date])
var _alert_table = SUMMARIZE(
    FILTER(ALL('Verizon Call Reason'),'Verizon Call Reason'[session_date]),
    'Verizon Call Reason'[call_reason_derived],"Measure",[Alert_V%]
    )
Return
COUNTROWS(FILTER(_alert_table,FIND("Share Volume: &amp;lt; 1.5 Std Dev",[Measure],,0)&amp;gt;0))&lt;/LI-CODE&gt;&lt;P&gt;In above, I am making a table based on category, take the most recent date as a variable _session_date. Then make another variable which filters out the table based on the measure. Then I want to count those rows with the phrase in the return.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should get 7 (as from the table above with alerts shown), but instead get BLANK(). Why? I have attached the source in this link:&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1PV3QN3iBIljIklEiK9HB6KeUMhclqjkL/view?usp=sharing" target="_self"&gt;PBIX Link&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;&amp;nbsp;has been a great help, and wanted to bring this back up.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 00:28:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1397729#M25690</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T00:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399439#M25727</link>
      <description>&lt;P&gt;Calling super DAX users -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The behavior that is causing OPs problem is that when you run a SUMMARIZE and/or FILTER on the fact table and add measures as new columns, everything goes to 1, 0 or blank. Whereas if you take the fact table with the measures and put them into a simple table visual the values show properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have attached a pbix that has left OP's code virtually untouched, but I created a table via SUMMARIZE, adding each of the individual measures that build up into the final measure. On the page "SU LOOK HERE", I've put the tables together side by side - Fact table with measures, and SUMMARIZE table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure something is going on with row/filter/other context and this is where it gets muddy for me. Any help appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt; &amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="12123" data-lia-user-login="vanessafvg" class="lia-mention lia-mention-user"&gt;vanessafvg&lt;/a&gt; &amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="32447" data-lia-user-login="tex628" class="lia-mention lia-mention-user"&gt;tex628&lt;/a&gt; &amp;nbsp;&lt;BR /&gt;Anonymous&lt;/a&gt; &amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="145085" data-lia-user-login="Tahreem24" class="lia-mention lia-mention-user"&gt;Tahreem24&lt;/a&gt; &amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="6799" data-lia-user-login="OwenAuger" class="lia-mention lia-mention-user"&gt;OwenAuger&lt;/a&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="226208" data-lia-user-login="mahoneypat" class="lia-mention lia-mention-user"&gt;mahoneypat&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="32333" data-lia-user-login="nandukrishnavs" class="lia-mention lia-mention-user"&gt;nandukrishnavs&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="31" data-lia-user-login="TomMartens" class="lia-mention lia-mention-user"&gt;TomMartens&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:14:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399439#M25727</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2020-09-28T13:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399501#M25734</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Like this: ?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Alert Sum_V% =
VAR _session_date =
    CALCULATE (
        MAX ( 'Verizon Call Reason'[session_date] ),
        ALL ( 'Verizon Call Reason' )
    )
VAR _alert_table =
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE ( 'Verizon Call Reason', 'Verizon Call Reason'[call_reason_derived] ),
            "@Alert", [Alert_V%]
        ),
        ALL ()
    )
VAR Result =
    FILTER (
        _alert_table,
        CONTAINSSTRING ( [@Alert], "Share Volume: &amp;gt; 1.5 Std Dev" )
    )
RETURN
    Result
&lt;/LI-CODE&gt;
&lt;P&gt;For measure just wrap Result inside COUNTROWS ()&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:44:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399501#M25734</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-09-28T13:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399665#M25737</link>
      <description>&lt;P&gt;This works like a dream! One question, I also want to count the number of std ev the other way too. You filtered for&lt;/P&gt;&lt;P&gt;"Share Volume: &amp;gt; 1.5 Std Dev"&lt;/P&gt;&lt;P&gt;And I want to also filter for&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Share Volume: &amp;lt; 1.5 Std Dev"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would that be:&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;Alert Sum_V% =
VAR _session_date =
    CALCULATE (
        MAX ( 'Verizon Call Reason'[session_date] ),
        ALL ( 'Verizon Call Reason' )
    )
VAR _alert_table =
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE ( 'Verizon Call Reason', 'Verizon Call Reason'[call_reason_derived] ),
            "@Alert", [Alert_V%]
        ),
        ALL ()
    )
VAR Result =
    CALCULATE(
       COUNTROWS(
         FILTER (
        _alert_table,
        CONTAINSSTRING ( [@Alert], "Share Volume: &amp;gt; 1.5 Std Dev" )
    )
FILTER (
        _alert_table,
        CONTAINSSTRING ( [@Alert], "Share Volume: &amp;lt; 1.5 Std Dev" )
    )
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;Seeing if I can go this route?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:43:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399665#M25737</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T14:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399688#M25738</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Do you mean 7 + rows for&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;"Share Volume: &amp;lt; 1.5 Std Dev"&amp;nbsp;&lt;/SPAN&gt;? then you can use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Alert Sum_V% = 
VAR _session_date =
    CALCULATE (
        MAX ( 'Verizon Call Reason'[session_date] ),
        ALL ( 'Verizon Call Reason' )
    )
VAR _alert_table =
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE ( 'Verizon Call Reason', 'Verizon Call Reason'[call_reason_derived] ),
            "@Alert", [Alert_V%]
        ),
        ALL ()
    )
VAR Result =
    FILTER (
        _alert_table,
        CONTAINSSTRING ( [@Alert], "Share Volume: &amp;gt; 1.5 Std Dev" ) 
            || CONTAINSSTRING ( [@Alert], "Share Volume: &amp;lt; 1.5 Std Dev" ) 
    )
RETURN
    COUNTROWS ( Result )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you prefer something that is more reusable then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Alert Sum_V% =
VAR _session_date =
    CALCULATE (
        MAX ( 'Verizon Call Reason'[session_date] ),
        ALL ( 'Verizon Call Reason' )
    )
VAR _alert_table =
    CALCULATETABLE (
        ADDCOLUMNS (
            SUMMARIZE ( 'Verizon Call Reason', 'Verizon Call Reason'[call_reason_derived] ),
            "@Alert", [Alert_V%]
        ),
        ALL ()
    )
VAR GreaterThan15 =
    FILTER (
        _alert_table,
        CONTAINSSTRING ( [@Alert], "Share Volume: &amp;gt; 1.5 Std Dev" )
    )
VAR LessThan15 =
    FILTER (
        _alert_table,
        CONTAINSSTRING ( [@Alert], "Share Volume: &amp;lt; 1.5 Std Dev" )
    )
VAR Result =
    COUNTROWS ( GreaterThan15 ) + COUNTROWS ( LessThan15 )
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:52:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1399688#M25738</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-09-28T14:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1400414#M25765</link>
      <description>&lt;P&gt;Thank you for your help, I did have an aside question - you made a variable for the maximum date in the query:&lt;/P&gt;&lt;PRE&gt;VAR _session_date =
    CALCULATE (
        MAX ( 'Verizon Call Reason'[session_date] ),
        ALL ( 'Verizon Call Reason' )
    )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But this is never used again in the&amp;nbsp; rest of the formula. How does PowerBI/DAX know how to use the final date when never referenced after making the variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 21:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1400414#M25765</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-28T21:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error with COUNTROWS() not finding the right FIND() text in a table.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1400805#M25778</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; That was just to replace the MAXX that you had in your formula. You can remove it if you don't need it.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 03:41:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-with-COUNTROWS-not-finding-the-right-FIND-text-in-a-table/m-p/1400805#M25778</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-09-29T03:41:07Z</dc:date>
    </item>
  </channel>
</rss>

