<?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: Distinct count across two tables with multiple critera in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-count-across-two-tables-with-multiple-critera/m-p/3617337#M139849</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description,, Please try code as below.&lt;BR /&gt;My Sample:&lt;BR /&gt;Order Table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Item Table:&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;Distinct Blue Customers = 
VAR _OrderTableBlue = CALCULATETABLE(
    VALUES('Order Table'[Customer ID]),
    FILTER(
        'Order Table',
        'Order Table'[Item Colour] = "Blue"
    )
)
VAR _ItemTableBlue = CALCULATETABLE(
    VALUES('Item Table'[Customer ID]),
    FILTER(
        'Item Table',
        'Item Table'[Item Colour] = "Blue"
    )
)
RETURN
COUNTROWS(
    INTERSECT(
        _OrderTableBlue,
        _ItemTableBlue
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Result is as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this reply still couldn't help resolve your issue, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2024 08:39:54 GMT</pubDate>
    <dc:creator>v-weiyan1-msft</dc:creator>
    <dc:date>2024-01-05T08:39:54Z</dc:date>
    <item>
      <title>Distinct count across two tables with multiple critera</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-count-across-two-tables-with-multiple-critera/m-p/3613246#M139693</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables, Order Table and Item Table, both of which have the same primary key which is customer ID.&lt;BR /&gt;&lt;BR /&gt;Both tables have a column which are similar but because of the way the database has been designed, they stand alone. Both have the column 'item colour'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to a distinct count of the Customer ID's where they have both ordered a blue item colour but I'm struggling to write a measure which will look at both tables and filter both tables on the columns I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 13:24:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-count-across-two-tables-with-multiple-critera/m-p/3613246#M139693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-03T13:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count across two tables with multiple critera</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-count-across-two-tables-with-multiple-critera/m-p/3617337#M139849</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description,, Please try code as below.&lt;BR /&gt;My Sample:&lt;BR /&gt;Order Table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Item Table:&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;Distinct Blue Customers = 
VAR _OrderTableBlue = CALCULATETABLE(
    VALUES('Order Table'[Customer ID]),
    FILTER(
        'Order Table',
        'Order Table'[Item Colour] = "Blue"
    )
)
VAR _ItemTableBlue = CALCULATETABLE(
    VALUES('Item Table'[Customer ID]),
    FILTER(
        'Item Table',
        'Item Table'[Item Colour] = "Blue"
    )
)
RETURN
COUNTROWS(
    INTERSECT(
        _OrderTableBlue,
        _ItemTableBlue
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Result is as below.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If this reply still couldn't help resolve your issue, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;BR /&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 08:39:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-count-across-two-tables-with-multiple-critera/m-p/3617337#M139849</guid>
      <dc:creator>v-weiyan1-msft</dc:creator>
      <dc:date>2024-01-05T08:39:54Z</dc:date>
    </item>
  </channel>
</rss>

