<?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: DISTINCTCOUNT on factTable based on 2 Criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2561546#M72887</link>
    <description>&lt;LI-CODE lang="markup"&gt;Num customers =
var semester1 = CALCULATETABLE( VALUES('Table'[Customer ID]), 
TREATAS( { ("Semester 1", 0)}, 'Table'[Semester], 'Table'[Values Euro]) )
var semester2 = CALCULATETABLE( VALUES('Table'[Customer ID]), 'Table'[Semester] = "Semester 2" &amp;amp;&amp;amp; 'Table'[Values Euro] &amp;gt; 0)
return DISTINCTCOUNT(UNION(semester1, semester2))&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 06 Jun 2022 15:17:15 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-06-06T15:17:15Z</dc:date>
    <item>
      <title>DISTINCTCOUNT on factTable based on 2 Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2561387#M72878</link>
      <description>&lt;P&gt;Hi Everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am quite new to DAX. I made my model really simple in the attached file .xlsx&lt;/P&gt;&lt;P&gt;I would like to compute a DISTINCTCOUNT of the FACT_TABLE[CUSTOMER ID] based on the following criteria:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Values for each "Customer ID" in the "1 SEMESTER" = 0 AND&amp;nbsp;Total Values for each "Customer ID" in the 2 SEMESTER &amp;gt;&amp;nbsp; 0&lt;/P&gt;&lt;P&gt;In this example CUSTOMER ID = 1 AND CUSTOMER ID = 3 are ok and they should be counted in the DISTINCTCOUNT because both have 1 semester = 0 and 2 semester &amp;gt; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://filetransfer.io/data-package/47cqvbpL#link" target="_blank" rel="noopener"&gt;https://filetransfer.io/data-package/47cqvbpL#link&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 14:26:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2561387#M72878</guid>
      <dc:creator>GianPaolo</dc:creator>
      <dc:date>2022-06-06T14:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT on factTable based on 2 Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2561546#M72887</link>
      <description>&lt;LI-CODE lang="markup"&gt;Num customers =
var semester1 = CALCULATETABLE( VALUES('Table'[Customer ID]), 
TREATAS( { ("Semester 1", 0)}, 'Table'[Semester], 'Table'[Values Euro]) )
var semester2 = CALCULATETABLE( VALUES('Table'[Customer ID]), 'Table'[Semester] = "Semester 2" &amp;amp;&amp;amp; 'Table'[Values Euro] &amp;gt; 0)
return DISTINCTCOUNT(UNION(semester1, semester2))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 06 Jun 2022 15:17:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2561546#M72887</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-06-06T15:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT on factTable based on 2 Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2562128#M72917</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For fun only, a showcase of powerful Excel worksheet formula,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 21:18:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2562128#M72917</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2022-06-06T21:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT on factTable based on 2 Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2563459#M72994</link>
      <description>&lt;P&gt;Thank you for your answer!! Unofortunately I am using Power Pivot and the TREATAS is not provided....&lt;/P&gt;&lt;P&gt;I think it is really a good idea the Excel flag you did...&lt;/P&gt;&lt;P&gt;DO you think would be possibile to add a calculated column in the model for doing the same thing as you did in the Excel Worksheet?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 09:19:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-on-factTable-based-on-2-Criteria/m-p/2563459#M72994</guid>
      <dc:creator>GianPaolo</dc:creator>
      <dc:date>2022-06-07T09:19:40Z</dc:date>
    </item>
  </channel>
</rss>

