<?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 how many had 2 specific values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936505#M9817</link>
    <description>&lt;P&gt;Hi &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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step1 is&amp;nbsp; Call and/or Intake (client can have 1 or both),&lt;/P&gt;&lt;P&gt;similarly Step2 is Assign and/or Schedule.&lt;/P&gt;&lt;P&gt;To make this less complicated I can add a calculated column = IF ([eventtype] = "Call" || [eventtype] = "Intake", "Step1", IF ([eventtype]="Assign" || [eventtype] = "Schedule", "Step2".&lt;/P&gt;&lt;P&gt;Then I will have a column of Step1, Step2 or null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you give me a DAX measure to say: how many clients have Step 1 AND Step2&lt;/P&gt;&lt;P&gt;and: What percentage of Clients have Step1 and Step2 out of all Clients that have Step1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 03:54:47 GMT</pubDate>
    <dc:creator>EF</dc:creator>
    <dc:date>2020-02-18T03:54:47Z</dc:date>
    <item>
      <title>counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936429#M9810</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I think this is a simple DAX measure (or 2) but as usual DAX stumps me...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a Facts table where each record is an event.&lt;BR /&gt;A client can have many event types.&lt;BR /&gt;I want a measure to count how many clients have received both event Step1 and Step2,&lt;BR /&gt;and calculate the percentage of clients who had Step2 following Step1, out of all Step1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;event types: Call, Intake, Assign, Schedule, Discharge.&lt;BR /&gt;TypeA = Call OR Intake&lt;BR /&gt;TypeB = Assign OR Schedule&lt;BR /&gt;note- Discharged is neither.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Columns: Date__clientID__EventType&lt;/P&gt;&lt;P&gt;1/1/20__ClientA__Call&lt;BR /&gt;1/1/20__ClientB__Call&lt;BR /&gt;1/2/20__ClientA__Intake&lt;BR /&gt;1/2/20__ClientC__Intake&lt;BR /&gt;1/2/20__ClientA__Assign&lt;BR /&gt;1/3/20__ClientC__Assign&lt;BR /&gt;1/3/20__ClientD__Schedule&lt;BR /&gt;1/4/20__ClientE__Discharge&lt;BR /&gt;1/4/20__ClientC__Schedule&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result =&lt;BR /&gt;Number of Clients with Step1 AND Step2 = 2 (ClientA and ClientC)&lt;BR /&gt;% of clients whose Step1 resulted in Step2 = 66% (clientA, ClientB, ClientC all had Step1 but only 2/3 had Step2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 02:58:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936429#M9810</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2020-02-18T02:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936495#M9816</link>
      <description>&lt;P&gt;Almost, I take it that Step 1 is Intake? And Step 2 is Assign? Is that really your source data? Likely need to split your column into 3 if that is the case. Once you do that, should be able to get the win using something like EXCEPT and some table variables that FILTER your base table.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 03:47:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936495#M9816</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-02-18T03:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936505#M9817</link>
      <description>&lt;P&gt;Hi &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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step1 is&amp;nbsp; Call and/or Intake (client can have 1 or both),&lt;/P&gt;&lt;P&gt;similarly Step2 is Assign and/or Schedule.&lt;/P&gt;&lt;P&gt;To make this less complicated I can add a calculated column = IF ([eventtype] = "Call" || [eventtype] = "Intake", "Step1", IF ([eventtype]="Assign" || [eventtype] = "Schedule", "Step2".&lt;/P&gt;&lt;P&gt;Then I will have a column of Step1, Step2 or null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you give me a DAX measure to say: how many clients have Step 1 AND Step2&lt;/P&gt;&lt;P&gt;and: What percentage of Clients have Step1 and Step2 out of all Clients that have Step1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 03:54:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936505#M9817</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2020-02-18T03:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936541#M9818</link>
      <description>&lt;P&gt;It's probably something along the lines of:&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;This is a measure for counting the number of customers with Step 1 and Step 2 = 
    VAR __Table = 
            SUMMARIZE(
                'Table',
                [Client],
                "Step 1",COUNTROWS(FILTER('Table',[Client] = EARLIER([Client]) &amp;amp;&amp;amp; [Step] = "Step 1")),
                "Step 2",COUNTROWS(FILTER('Table',[Client] = EARLIER([Client]) &amp;amp;&amp;amp; [Step] = "Step 2"))
            )
RETURN
    COUNTROWS(FILTER(__Table,[Step 1] &amp;gt; 0 &amp;amp;&amp;amp; [Step 2] &amp;gt; 0 ))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached a PBIX. To get the percentage, just divide this measure by a COUNTROWS of DISTINCT [Clients].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you run into problems, I can take a look at it tomorrow, I've had a fair bit of Scotch and need to call it a night.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 04:35:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/936541#M9818</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-02-18T04:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/937787#M9864</link>
      <description>&lt;P&gt;Thank you!!&lt;/P&gt;&lt;P&gt;This worked perfectly, and I used it in various forms already!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 19:45:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/937787#M9864</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2020-02-18T19:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/939418#M9958</link>
      <description>&lt;P&gt;Hi &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;/P&gt;&lt;P&gt;Another question on this. Can you adjust the measure so that it does not get affected by date slicers?&lt;/P&gt;&lt;P&gt;I do want to slice it by other slicers/filters but not by date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;EF&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 17:43:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/939418#M9958</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2020-02-19T17:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/939463#M9962</link>
      <description>&lt;P&gt;Sure, you would do something along the lines of:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;This is a measure for counting the number of customers with Step 1 and Step 2 = 
    VAR __Table = 
            SUMMARIZE(
                CALCULATETABLE('Table',REMOVEFILTERS('Date'[Date]))
                [Client],
                "Step 1",COUNTROWS(FILTER('Table',[Client] = EARLIER([Client]) &amp;amp;&amp;amp; [Step] = "Step 1")),
                "Step 2",COUNTROWS(FILTER('Table',[Client] = EARLIER([Client]) &amp;amp;&amp;amp; [Step] = "Step 2"))
            )
RETURN
    COUNTROWS(FILTER(__Table,[Step 1] &amp;gt; 0 &amp;amp;&amp;amp; [Step 2] &amp;gt; 0 ))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:08:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/939463#M9962</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-02-19T18:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/939501#M9965</link>
      <description>&lt;P&gt;That worked! there was one missing comma after the calculatetable line, but eventually I figured that out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you! Much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 18:35:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/939501#M9965</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2020-02-19T18:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: counting how many had 2 specific values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/955859#M10959</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to add a layer of complexity to this measure that I am hoping you can once again help me with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I agree that EARLIER is a terrific function, I wish I understood how it works better!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used a version of this measure to create a WaitList: Clients whohad Step 1 (Intake) but not step 2 (assigned), using this code:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;WaitList = VAR __Table = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMMARIZE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE(EventTable,REMOVEFILTERS(DateTable[Date])),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[client],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Step 1",COUNTROWS(FILTER(EventTable,[client] = EARLIER([client]) &amp;amp;&amp;amp; [step] = "Step 1" )),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Step 2",COUNTROWS(FILTER(EventTable,[client] = EARLIER([client]) &amp;amp;&amp;amp; [step] = "Step 2"))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTRows(FILTER(__Table,([Step 1] &amp;gt; 0 &amp;amp;&amp;amp; [Step 2] = 0 )))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;works well.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;However, a client can go through the system more than once. If that happens, the above measure will find that Step 2 is greater than 0 because they have been assigned in the past, but they are really back in Intake and on the waiting list to be assigned.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What would you suggest? I created a table in Query Editor to number the episodes of care ([Client]/[index]/[episode#] where each Step 1 begins a new episode), but not sure how to bring that into this calculation.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you for your continued assistance!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Mar 2020 20:13:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/counting-how-many-had-2-specific-values/m-p/955859#M10959</guid>
      <dc:creator>EF</dc:creator>
      <dc:date>2020-03-02T20:13:33Z</dc:date>
    </item>
  </channel>
</rss>

