<?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 distinct values based on single column criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2773437#M86440</link>
    <description>&lt;P&gt;This actually worked, thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the only thing I need to implement is date range.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 12:03:39 GMT</pubDate>
    <dc:creator>athgeorge</dc:creator>
    <dc:date>2022-09-16T12:03:39Z</dc:date>
    <item>
      <title>Count distinct values based on single column criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2770507#M86237</link>
      <description>&lt;P&gt;Hello everyone, bear with me because Im not sure how to present my issue :).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to recreate a similar report that I have in Data studio to Power BI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main issue is the treemap graph bellow. The google sheet I am using for that graph has a singe column Interests targeting, with all the values separeted with comma. So I ve created a new dimension that uses the bellow regexp and counts distinct all the interests and groups them under their respective pillar.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;when (REGEXP_MATCH(Interest targeting,".*Performing arts.*")) then "Performing arts"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now in power bi, I've used the split column and created multiple interest targeting columns as shown bellow.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issue is, I cant find a way to match all the interests to their repsective pillar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 13:01:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2770507#M86237</guid>
      <dc:creator>athgeorge</dc:creator>
      <dc:date>2022-09-15T13:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct values based on single column criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2772482#M86357</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="442309" data-lia-user-login="athgeorge" class="lia-mention lia-mention-user"&gt;athgeorge&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;What kind of result do you want to match for this regular expression? I didn't find which column the interest targeting matched in the data below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide us with detailed input and output examples in tabular form so that we can better solve the problem for you.&amp;nbsp;Please take care to protect your private data.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Neeko Tang&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;, then please consider&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 06:47:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2772482#M86357</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-16T06:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct values based on single column criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2772842#M86387</link>
      <description>&lt;P&gt;Hi Neeko,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data source is in tabular format, so Im gonna try and give you an exaple table bellow:&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;Pillars&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Interst targeting.1&lt;/TD&gt;&lt;TD&gt;Interst targeting.2&lt;/TD&gt;&lt;TD&gt;Interst targeting.3&lt;/TD&gt;&lt;TD&gt;Interst targeting.4&lt;/TD&gt;&lt;TD&gt;Interst targeting.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Pillar1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Interest1&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Interest2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Interest3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Interest4&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pillar2&lt;/TD&gt;&lt;TD&gt;Interest1&lt;/TD&gt;&lt;TD&gt;Interest2&lt;/TD&gt;&lt;TD&gt;Interest3&lt;/TD&gt;&lt;TD&gt;Interest5&lt;/TD&gt;&lt;TD&gt;Interest5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Pillar1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;Interest1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Interest4&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Interest5&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pillar3&lt;/TD&gt;&lt;TD&gt;Interest1&lt;/TD&gt;&lt;TD&gt;Interest4&lt;/TD&gt;&lt;TD&gt;Interest4&lt;/TD&gt;&lt;TD&gt;Interest1&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Pillar3&lt;/TD&gt;&lt;TD&gt;Interest1&lt;/TD&gt;&lt;TD&gt;Interest2&lt;/TD&gt;&lt;TD&gt;Interest4&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data i want to extract and show in a graph is, the sum of all the unique interests per pillar.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pillar1 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2x&lt;/STRONG&gt;Interst1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1x&lt;/STRONG&gt;Interest2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1x&lt;/STRONG&gt;Interest3&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2x&lt;/STRONG&gt;Interests4&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1x&lt;/STRONG&gt;Interest5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pillar3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3x&lt;/STRONG&gt;Interst1&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1x&lt;/STRONG&gt;Interest2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3x&lt;/STRONG&gt;Interests4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I am trying to find a function that can count distinct all the interests from all the Interest targeting columns to each respective Pillar from multiple rows (of the Pillar column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry if this still doesn't make sense, English is not my primary language &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 08:46:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2772842#M86387</guid>
      <dc:creator>athgeorge</dc:creator>
      <dc:date>2022-09-16T08:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct values based on single column criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2773195#M86412</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi @&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/442309" target="_blank"&gt;athgeorge&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;According to your description, you want to count distinct values based on single column criteria ,right? Here are my steps you can follow as a solution.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;(1)&lt;/SPAN&gt;&lt;SPAN&gt;Here are my test data.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(2)The operation of selecting the first column and reversing the other columns.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(3)&lt;/SPAN&gt;&lt;SPAN&gt;Delete the second column [Attribute].&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(4)Filter on the [Values] column.&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;
&lt;P&gt;(5)&lt;SPAN&gt;Create a table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table 2 = VALUES('Table'[Value])&lt;/LI-CODE&gt;
&lt;P&gt;The table relationship is shown in the following figure.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(6)Create a visual as shown in the following image.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(7)Then the result is as follows.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this method does not meet your needs, you can provide us with detailed input and output examples in tabular form so that we can better solve the problem for you.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Neeko Tang&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;, then please consider&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:29:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2773195#M86412</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-09-16T10:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count distinct values based on single column criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2773437#M86440</link>
      <description>&lt;P&gt;This actually worked, thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the only thing I need to implement is date range.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:03:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-distinct-values-based-on-single-column-criteria/m-p/2773437#M86440</guid>
      <dc:creator>athgeorge</dc:creator>
      <dc:date>2022-09-16T12:03:39Z</dc:date>
    </item>
  </channel>
</rss>

