<?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 of common values - only using DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1157571#M17720</link>
    <description>&lt;P&gt;Here you go:&lt;/P&gt;&lt;P&gt;In case you do not want to create a relationship between your base table the filter table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EngineerCount = 
VAR EngineerCount = VALUES('Table'[Engineer])
VAR FilterEngineerCount = CALCULATETABLE(VALUES('Table'[Engineer]);ALL('Table');TREATAS(VALUES(FilterStates[State]); 'Table'[State]))

RETURN
COUNTROWS(INTERSECT(EngineerCount;FilterEngineerCount))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case you can create an inactive relationship:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EngineersinBotStates = 
CALCULATE (
    DISTINCTCOUNT ('Table'[Engineer] );
    CALCULATETABLE (
        SUMMARIZE ( 'Table';'Table'[Engineer] );
        ALL ( 'Table');
        USERELATIONSHIP ( 'Table'[State]; FilterStates[State] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is based on this article:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.daxpatterns.com/basket-analysis/" target="_blank" rel="noopener"&gt;https://www.daxpatterns.com/basket-analysis/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result can be seen here, please note the data model and the use of a filtered states table, which is created with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FilterStates = SUMMARIZE('Table';'Table'[State])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;File is available &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdgeNJSWWqcr5TQk5w?e=dNwtHN" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please mark as solution if this works for you.&lt;/STRONG&gt; Thumbs up for the effort is appreciated.&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jun 2020 08:09:59 GMT</pubDate>
    <dc:creator>stevedep</dc:creator>
    <dc:date>2020-06-14T08:09:59Z</dc:date>
    <item>
      <title>count of common values - only using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1157521#M17717</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this is in continuation of&amp;nbsp;&lt;A title="Old post" href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Count-of-common-values-Tricky/m-p/1118286" target="_self"&gt;Old post&lt;/A&gt;&amp;nbsp;. An awsome solution was given by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="215853" data-lia-user-login="camargos88" class="lia-mention lia-mention-user"&gt;camargos88&lt;/a&gt;&amp;nbsp;using power query - join. Now I have realised that raw data size is huge and I need multiple charts and foreach combination I don't want to create join. I want to do it using DAX alone. Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data like below:&lt;/P&gt;&lt;P&gt;State | Engineer|&amp;nbsp;&lt;/P&gt;&lt;P&gt;Florida, Johny&lt;/P&gt;&lt;P&gt;Florida, Nick&lt;/P&gt;&lt;P&gt;Indiana, Johny&lt;/P&gt;&lt;P&gt;Indiana, Nick&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want a pivot table like below which shows common engineer between states.&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;State&lt;/TD&gt;&lt;TD&gt;Florida&lt;/TD&gt;&lt;TD&gt;Indiana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Florida&lt;/TD&gt;&lt;TD&gt;NA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Indiana&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;NA&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Santhosh K&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 05:18:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1157521#M17717</guid>
      <dc:creator>Greatbi1</dc:creator>
      <dc:date>2020-06-14T05:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: count of common values - only using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1157571#M17720</link>
      <description>&lt;P&gt;Here you go:&lt;/P&gt;&lt;P&gt;In case you do not want to create a relationship between your base table the filter table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EngineerCount = 
VAR EngineerCount = VALUES('Table'[Engineer])
VAR FilterEngineerCount = CALCULATETABLE(VALUES('Table'[Engineer]);ALL('Table');TREATAS(VALUES(FilterStates[State]); 'Table'[State]))

RETURN
COUNTROWS(INTERSECT(EngineerCount;FilterEngineerCount))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case you can create an inactive relationship:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EngineersinBotStates = 
CALCULATE (
    DISTINCTCOUNT ('Table'[Engineer] );
    CALCULATETABLE (
        SUMMARIZE ( 'Table';'Table'[Engineer] );
        ALL ( 'Table');
        USERELATIONSHIP ( 'Table'[State]; FilterStates[State] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is based on this article:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.daxpatterns.com/basket-analysis/" target="_blank" rel="noopener"&gt;https://www.daxpatterns.com/basket-analysis/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result can be seen here, please note the data model and the use of a filtered states table, which is created with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FilterStates = SUMMARIZE('Table';'Table'[State])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;File is available &lt;A href="https://1drv.ms/u/s!AvU6hhKLfmEcgdgeNJSWWqcr5TQk5w?e=dNwtHN" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please mark as solution if this works for you.&lt;/STRONG&gt; Thumbs up for the effort is appreciated.&lt;/P&gt;&lt;P&gt;Kind regards, Steve.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jun 2020 08:09:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1157571#M17720</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-14T08:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: count of common values - only using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1167885#M17951</link>
      <description>&lt;P&gt;Thank you steve for detailed explanantion. I really appreciate your approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 06:56:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/count-of-common-values-only-using-DAX/m-p/1167885#M17951</guid>
      <dc:creator>Greatbi1</dc:creator>
      <dc:date>2020-06-18T06:56:42Z</dc:date>
    </item>
  </channel>
</rss>

