<?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: Count number of users with certain badges in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998784#M12611</link>
    <description>&lt;P&gt;Thanks! But now I think the number is too high - with "OR"/"||", it is now showing the users who have either Beginner, or Intermediate, or Both...&amp;nbsp; For my needs I need to find the distinct count of users who have Beginner and Intermediate (but of course, those two values would be in different cells)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2020 15:22:21 GMT</pubDate>
    <dc:creator>jxg104</dc:creator>
    <dc:date>2020-03-30T15:22:21Z</dc:date>
    <item>
      <title>Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998331#M12594</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I am looking to produce a count of the number of users in a community with a certain skill levels. The&amp;nbsp;is as follows:&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;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Badge&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;Beginner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;Intermediate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;Advanced&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Helen&lt;/TD&gt;&lt;TD&gt;Beginner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Helen&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Intermediate&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jane&lt;/TD&gt;&lt;TD&gt;Beginner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jane&lt;/TD&gt;&lt;TD&gt;Intermediate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jane&lt;/TD&gt;&lt;TD&gt;Advanced&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jane&lt;/TD&gt;&lt;TD&gt;Power User&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Brian&lt;/TD&gt;&lt;TD&gt;Beginner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;David&lt;/TD&gt;&lt;TD&gt;Beginner&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;David&lt;/TD&gt;&lt;TD&gt;Power User&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to make the following counts in a Card on a dashboard&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Number of users who have Beginner and Intermediate and ... (but not ONLY those values, they could have more too)&lt;/LI&gt;&lt;LI&gt;Number of users who have Beginner and Intermediate, but not Advanced.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Since the card is static, I would like to code the Badge into the query and not use a slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have had a look round the forum about Basket Analysis and using double pipes, but I can't find a solution that uses the right syntax without using a slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 11:13:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998331#M12594</guid>
      <dc:creator>jxg104</dc:creator>
      <dc:date>2020-03-30T11:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998414#M12597</link>
      <description>&lt;P&gt;Hi, you can build measures like this:&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;LI-CODE lang="markup"&gt;Measure 1 =
CALCULATE (
    DISTINCTCOUNT(Table[Name]), 
    FILTER(
        SUMMARIZECOLUMNS(
            Table[Name],
            "@beginner", CALCULATE(COUNT(Table[Name]),Table[Badge]="Beginner"),
            "@intermediate", CALCULATE(COUNT(Table[Name]),Table[Badge]="Intermediate")
        ),
        [@beginner] + [@intermediate] = 2
    )
)&lt;/LI-CODE&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;This case will check if they have both beginner and intermediate without caring if they have advance or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now let's check the other measure:&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;LI-CODE lang="markup"&gt;Measure 2 =
CALCULATE (
    DISTINCTCOUNT(Table[Name]), 
    FILTER(
        SUMMARIZECOLUMNS(
            Table[Name],
            "@beginner", CALCULATE(COUNT(Table[Name])Table[Badge]="Beginner"),
            "@intermediate", CALCULATE(COUNT(Table[Name]),Table[Badge]="Intermediate"),
            "@advanced", CALCULATE(COUNT(Table[Name]),Table[Badge]="Advanced")
        ),
        [@beginner] + [@intermediate] + [@advanced] = 3
    )
)&lt;/LI-CODE&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;This second way will check they are beginner and intermediate but NOT advanced.&lt;BR /&gt;You have to avoid interactions between filters and the card with this measure in order to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 16:06:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998414#M12597</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-03-30T16:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998601#M12602</link>
      <description>&lt;P&gt;Amazing, thanks! This helps a lot! As a follow-up question, how could a filter to look at a combination of (for example) 4 badges? Since the AND only allows 2 arguments? Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998601#M12602</guid>
      <dc:creator>jxg104</dc:creator>
      <dc:date>2020-03-30T14:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998671#M12607</link>
      <description>&lt;P&gt;Well you don't have to use AND () if you don't want to. You can add all you want like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FILTER(
    Table,
    Condition 1 &amp;amp;&amp;amp; Condition 2 &amp;amp;&amp;amp; ... &amp;amp;&amp;amp; Condition N
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;AND is a helpful function when you need to ask for two and want everything in an order, but it's not mandatory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out the second code I have sent. It contains an "AND" and then &amp;amp;&amp;amp;. You can use AND ( AND ( AND ( .... ) ) ) or the symbol &amp;amp;&amp;amp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:27:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998671#M12607</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-03-30T14:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998733#M12609</link>
      <description>&lt;P&gt;When I apply these functions to the data, it keeps returning the message (Blank). If I only add one of the arguments (e.g. only Begineer), it counts fine, but with 2, it comes up blank. Could it be that the function would look for "Beginner" and "Intermediate" in the same cell? Not sure what I have done wrong...&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:00:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998733#M12609</guid>
      <dc:creator>jxg104</dc:creator>
      <dc:date>2020-03-30T15:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998767#M12610</link>
      <description>&lt;P&gt;Oh! I have a silly mistake sorry. You shouldn't use AND. You have to use OR haha. Like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 1 =
CALCULATE (
    DISTINCTCOUNT(Table[Name]),
    FILTER(
        ALL(Table[Badge]),
        OR(Table[Badge] = "Beginner", Table[Badge]="Intermediate")
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The symbol for the OR are double pipes "||" instead of &amp;amp;&amp;amp;.&lt;/P&gt;
&lt;P&gt;That's why it was null, a row can't be "Beginner" and&amp;nbsp; "Intermediate" at the same time haha.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FirstPost EDITED to be with OR&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:17:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998767#M12610</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-03-30T15:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998784#M12611</link>
      <description>&lt;P&gt;Thanks! But now I think the number is too high - with "OR"/"||", it is now showing the users who have either Beginner, or Intermediate, or Both...&amp;nbsp; For my needs I need to find the distinct count of users who have Beginner and Intermediate (but of course, those two values would be in different cells)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:22:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998784#M12611</guid>
      <dc:creator>jxg104</dc:creator>
      <dc:date>2020-03-30T15:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998805#M12614</link>
      <description>&lt;P&gt;Check out the attached file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:33:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998805#M12614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-30T15:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998807#M12615</link>
      <description>&lt;P&gt;I see mi mistake. It's a tricky measure. Before I blow my mind with this let me ask. Do you have any other value rather than advanced, intermediate and beginner? and in order to be an advanced, do you have to be first intermediate and beginner?&lt;/P&gt;
&lt;P&gt;I have to ask because if your answer is yes to both, then it should this simple:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 =
CALCULATE (
    DISTINCTCOUNT(Table[Name]),
    Table[Badge] &amp;lt;&amp;gt; "Advanced"
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;If the answer is no, we should analyze a bit more to prepare this in a different way.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:36:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/998807#M12615</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-03-30T15:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of users with certain badges</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/1000015#M12653</link>
      <description>The measure with SUMMARIZECOLUMNS is wrong. SUMMARIZECOLUMNS must not be use in measures since the function does not recognize context transition. It can only be safely used in queries.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Tue, 31 Mar 2020 07:10:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-number-of-users-with-certain-badges/m-p/1000015#M12653</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-31T07:10:51Z</dc:date>
    </item>
  </channel>
</rss>

