<?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: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3744649#M146034</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284783" data-lia-user-login="gingerclaire" class="lia-mention lia-mention-user"&gt;gingerclaire&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My understanding is that you can use the DISTINCTCOUNT function if you want to get a different count of "accountid" using a measure in Power BI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This function counts the number of non-duplicate values in a column. If you want to know more about it, please see:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/distinctcount-function-dax" target="_blank"&gt;DISTINCTCOUNT function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distinct Account Activities = DISTINCTCOUNT('accounts'[accountid])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate it if you could provide me with sample data that does not contain your private information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2024 02:37:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-06T02:37:41Z</dc:date>
    <item>
      <title>How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3743738#M145997</link>
      <description>&lt;P&gt;I have a model which has four different tables for different kinds of sales activities (how our database is set up and I can't merge them as the four tables are different). They are all linked to a table called 'accounts' which holds all of the info on the account that the activity happened to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already have a measure which totals up all the activities that happened.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT multiple activities can happen at one account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I take my measure which basically counts rows in the activity tables and get it to dedupe by or give a distinct count of 'accountid'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or do I need to make a virtual table? and if so, how?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDITED TO ADD MORE INFO:&lt;/P&gt;&lt;P&gt;Table 1: Appointments&lt;/P&gt;&lt;P&gt;Table 2: CPD&lt;/P&gt;&lt;P&gt;Table 3: FOBs&lt;/P&gt;&lt;P&gt;Table 4: Q4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above are all types of sales activities. They are all linked to (among many others):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 5: Account info&lt;/P&gt;&lt;P&gt;Table 6: Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a measure that counts the number of activities (counting rows) in each of the first four tables. (Total appointments) (Total FOBs) (Total CPD) (Total Q4)&lt;/P&gt;&lt;P&gt;I have a measure that then adds all of these together (Total activities) which gives me the total number of these activities. But i want to identify the total distinct number of activities where these activities have taken place (as one account may have had many activities).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do it using these existing measures?&lt;/P&gt;&lt;P&gt;Or is there a way to get a list of account IDs from Tables, 1,2,3,4 and distinct count that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 10:17:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3743738#M145997</guid>
      <dc:creator>gingerclaire</dc:creator>
      <dc:date>2024-03-06T10:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3743902#M146000</link>
      <description>&lt;P&gt;I would like to help but I'm a little unclear about your requirements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you show the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;.&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Please show the &lt;STRONG&gt;expected outcome&lt;/STRONG&gt; based on the sample data you provided.&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Please &lt;STRONG&gt;explain&lt;/STRONG&gt; how you would expect to get from step 1 to 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) If possible, please show your past attempts at a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A .pbix file would be best.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 18:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3743902#M146000</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-03-05T18:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3744649#M146034</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284783" data-lia-user-login="gingerclaire" class="lia-mention lia-mention-user"&gt;gingerclaire&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My understanding is that you can use the DISTINCTCOUNT function if you want to get a different count of "accountid" using a measure in Power BI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This function counts the number of non-duplicate values in a column. If you want to know more about it, please see:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/distinctcount-function-dax" target="_blank"&gt;DISTINCTCOUNT function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distinct Account Activities = DISTINCTCOUNT('accounts'[accountid])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would appreciate it if you could provide me with sample data that does not contain your private information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 02:37:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3744649#M146034</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-06T02:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3745859#M146080</link>
      <description>&lt;P&gt;I have added more info above - I can't include sample data due to company policy.&lt;/P&gt;&lt;P&gt;I can do a distinct count in one table - the problem is i need to be able to make a list from tables 1,2,3,4 and then do the distinct count of a column in table 5. PLease see edited question for more info &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 11:01:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3745859#M146080</guid>
      <dc:creator>gingerclaire</dc:creator>
      <dc:date>2024-03-06T11:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3745872#M146081</link>
      <description>&lt;P&gt;I have added more info above to my edited question - I can't include sample data sadly due to company policy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to end up with a distinct count of accountids (table 5) where there had been ANY activities (tables 1-4).&lt;/P&gt;&lt;P&gt;I have a measure to count the activities but i do not know how to narrow that down to count the accountids (there are more than one activity at each account)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can do a distinct count in one table - the problem is i need to be able to make a list from tables 1,2,3,4 and then do the distinct count of a column in table 5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PLease see edited question for more info &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 11:09:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3745872#M146081</guid>
      <dc:creator>gingerclaire</dc:creator>
      <dc:date>2024-03-06T11:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3747871#M146179</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284783" data-lia-user-login="gingerclaire" class="lia-mention lia-mention-user"&gt;gingerclaire&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the more detailed description, it is very helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please follow these steps:&lt;/P&gt;
&lt;P&gt;1. Here is the raw data and model relationship diagram I created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Accounts table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appointments table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CPD table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FOBs table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q4 table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Modeling relationship:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Please try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR __table1 = VALUES('Appointments'[Activity])
VAR __table2 = VALUES('CPD'[Activity])
VAR __table3 = VALUES('FOBs'[Activity])
VAR __table4 = VALUES('Q4'[Activity])
VAR __union_tables = UNION(__table1,__table2,__table3,__table4)
VAR __result = COUNTROWS(DISTINCT(__union_tables))
RETURN
__result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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;This should now fulfill your needs, if you have any other questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The pbix file is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 05:56:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3747871#M146179</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-07T05:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can a distinctcount or de-dupe a measure? Or hwo do i make a virtual table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3758002#M146613</link>
      <description>&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;I have just set this up and am running some checks but it seems to be working!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to be able to count the number of accounts that had AN activity at it, so I changed the DAX formula slightly:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
VAR __table1 = VALUES('Appointments'[AccountID])
VAR __table2 = VALUES('CPD'[AccountID])
VAR __table3 = VALUES('FOBs'[AccountID])
VAR __table4 = VALUES('Q4'[AccountID])
VAR __union_tables = UNION(__table1,__table2,__table3,__table4)
VAR __result = COUNTROWS(DISTINCT(__union_tables))
RETURN
__result&lt;/LI-CODE&gt;&lt;P&gt;I will let you know (and mark as correct) if the solution works and passes my manual check &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 13:03:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-a-distinctcount-or-de-dupe-a-measure-Or-hwo-do-i-make-a/m-p/3758002#M146613</guid>
      <dc:creator>gingerclaire</dc:creator>
      <dc:date>2024-03-12T13:03:34Z</dc:date>
    </item>
  </channel>
</rss>

