<?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 Distinct Count from 2 Measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3776755#M147610</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 tables, each with a measure. Eventually, i will have 3 measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main data i am trying to count is the # of Unique Employees who are "Active" THIS MONTH. I am pulling data from Dataverse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Active employee = 1 job filled out, or 1 observation performed as observer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have 2 measures, with date filters set to the visual of is in this month.&lt;/P&gt;&lt;P&gt;Measure 1 = Active Employees as Observer This Month&lt;/P&gt;&lt;P&gt;Measure 2 = Active Employees w Job filled Out&lt;/P&gt;&lt;P&gt;Both data fields that are called contain Employee Names. These match across tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am needing to find the distinct count of total employees that are active. If one employee exists in both measures, they are counted as 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2024 02:46:34 GMT</pubDate>
    <dc:creator>Cameron_ITS</dc:creator>
    <dc:date>2024-03-20T02:46:34Z</dc:date>
    <item>
      <title>Distinct Count from 2 Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3776755#M147610</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 tables, each with a measure. Eventually, i will have 3 measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main data i am trying to count is the # of Unique Employees who are "Active" THIS MONTH. I am pulling data from Dataverse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Active employee = 1 job filled out, or 1 observation performed as observer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have 2 measures, with date filters set to the visual of is in this month.&lt;/P&gt;&lt;P&gt;Measure 1 = Active Employees as Observer This Month&lt;/P&gt;&lt;P&gt;Measure 2 = Active Employees w Job filled Out&lt;/P&gt;&lt;P&gt;Both data fields that are called contain Employee Names. These match across tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am needing to find the distinct count of total employees that are active. If one employee exists in both measures, they are counted as 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 02:46:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3776755#M147610</guid>
      <dc:creator>Cameron_ITS</dc:creator>
      <dc:date>2024-03-20T02:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count from 2 Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3777063#M147626</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To achieve the distinct count of total employees that are active, considering that if an employee exists in both measures they should be counted only once, you can create a new measure in Power BI using DAX. You can use the UNION function to combine the lists of active employees from both measures and then count the distinct values. Here's how you can do it:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Total Active Employees =&lt;BR /&gt;VAR ActiveEmployees1 =&lt;BR /&gt;VALUES('Table1'[EmployeeName]) // Replace 'Table1' with the actual name of your table for Measure 1&lt;BR /&gt;VAR ActiveEmployees2 =&lt;BR /&gt;VALUES('Table2'[EmployeeName]) // Replace 'Table2' with the actual name of your table for Measure 2&lt;BR /&gt;VAR AllActiveEmployees =&lt;BR /&gt;UNION(ActiveEmployees1, ActiveEmployees2)&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTROWS(AllActiveEmployees)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Replace 'Table1' and 'Table2' with the actual names of your tables where the measures are defined. This DAX measure will give you the distinct count of total employees that are active, considering both measures. If an employee exists in both measures, they will only be counted once.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 05:08:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3777063#M147626</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-03-20T05:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count from 2 Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3779978#M147696</link>
      <description>&lt;P&gt;Thank you for the reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i attempt to put the name of the measures inside the value() funciton, my measure names do NOT&amp;nbsp; populate, and when i enter the direct name I receive an error.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 15:38:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3779978#M147696</guid>
      <dc:creator>Cameron_ITS</dc:creator>
      <dc:date>2024-03-20T15:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count from 2 Measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3785496#M147863</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;, Thanks for your contribution on this thread, the provided method is good.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="708629" data-lia-user-login="Cameron_ITS" class="lia-mention lia-mention-user"&gt;Cameron_ITS&lt;/a&gt;..&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp;has&amp;nbsp;&lt;SPAN&gt;offered valuable advice on your post. He mentioned the &lt;A href="https://learn.microsoft.com/en-us/dax/values-function-dax" target="_self"&gt;&lt;STRONG&gt;VALUES&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;function, not the VALUE function. The VALUES function can only refer to a &lt;STRONG&gt;column name&lt;/STRONG&gt;, and measure cannot be referenced by this function. Based on your description, it appears that you are attempting to obtain a unique value for the number of items involved in two measures. You can create the following measure to achieve this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;NewMeasure =
VAR _tab1 =
    CALCULATETABLE (
        VALUES ( 'Table'[employee] ),
        FILTER (
            'Table',
            'Table'[type] = "Observer"
                &amp;amp;&amp;amp; MONTH ( 'Table'[HireDate] ) = MONTH ( TODAY () )
        )
    )
VAR _tab2 =
    CALCULATETABLE (
        VALUES ( 'Table'[employee] ),
        FILTER ( 'Table', 'Table'[Job] = "Filled Out" )
    )
VAR _tab3 =
    DISTINCT ( UNION ( _tab1, _tab2 ) )
RETURN
    COUNTROWS ( _tab3 )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 08:53:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-from-2-Measures/m-p/3785496#M147863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-22T08:53:56Z</dc:date>
    </item>
  </channel>
</rss>

