<?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: Returning distinct values using a Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4235060#M167488</link>
    <description>&lt;P&gt;&lt;A href="https://qgate-my.sharepoint.com/:u:/g/personal/matt_trollope_qgate_co_uk/EfAECmdISh9GqjVjkgHtq5QB3mwHvHDVaUJJh3iEzAg1Qw?e=sm15P8" target="_self"&gt;Contact_Role&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I have attached link to example pbix file demonstrating the problem. I'm trying to find the number of distinct Contacts with active Roles on a given date (not the number of roles each Contact has on the given date). The example shows the number of roles each contact has on the date. In the screenshot below I want to show 1 DistinctActiveRole for each Contact in the lower table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks for your assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 10:22:16 GMT</pubDate>
    <dc:creator>MattTrollope</dc:creator>
    <dc:date>2024-10-09T10:22:16Z</dc:date>
    <item>
      <title>Returning distinct values using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4233927#M167450</link>
      <description>&lt;P&gt;I need my Date Table to operate on both the Join and Close dates of an entity to capture the number of contacts with a role on a given date. As I can only have one active relationship, I'm using a Measure to capture this data:&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 returns 1 for each qualifying row in the 'Role' entity, so I can use this to determine the total number of contacts with roles. Because some contacts have several roles it returns a row for each role, but I need it to show the number of 'distinct' contacts with roles, and can't find a way to achieve this. Any assistance would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2024 16:20:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4233927#M167450</guid>
      <dc:creator>MattTrollope</dc:creator>
      <dc:date>2024-10-08T16:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Returning distinct values using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4234459#M167468</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398760" data-lia-user-login="MattTrollope" class="lia-mention lia-mention-user"&gt;MattTrollope&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Do you want to get the number of 'distinct' contacts with roles? Could you please&amp;nbsp;provide some&amp;nbsp;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&amp;nbsp;in your tables(&lt;EM&gt;&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;&lt;/EM&gt;) with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;format&amp;nbsp;and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples? It would be helpful to find out the solution. You can refer the following link to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C02%7Cv-yiruan%40microsoft.com%7C53fc6c10cb1b4eb7674a08dcbb706f15%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638591338796956339%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=ch1lYvp%2FLCdQ3b%2B7X%2BIVvRJvmkHiOxXDbPRDD98PQBM%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=05%7C02%7Cv-yiruan%40microsoft.com%7C53fc6c10cb1b4eb7674a08dcbb706f15%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638591338796961969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=zCKrQrPHsjUDUuTNi6jD7JTkJGhAamtaWvYTTqZfEHo%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 03:15:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4234459#M167468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-09T03:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Returning distinct values using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4235060#M167488</link>
      <description>&lt;P&gt;&lt;A href="https://qgate-my.sharepoint.com/:u:/g/personal/matt_trollope_qgate_co_uk/EfAECmdISh9GqjVjkgHtq5QB3mwHvHDVaUJJh3iEzAg1Qw?e=sm15P8" target="_self"&gt;Contact_Role&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;I have attached link to example pbix file demonstrating the problem. I'm trying to find the number of distinct Contacts with active Roles on a given date (not the number of roles each Contact has on the given date). The example shows the number of roles each contact has on the date. In the screenshot below I want to show 1 DistinctActiveRole for each Contact in the lower table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thanks for your assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 10:22:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4235060#M167488</guid>
      <dc:creator>MattTrollope</dc:creator>
      <dc:date>2024-10-09T10:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Returning distinct values using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4236219#M167566</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398760" data-lia-user-login="MattTrollope" class="lia-mention lia-mention-user"&gt;MattTrollope&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below to get the number of distinct contacts, please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Number of distinct Contacts = 
VAR _date =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Role'[ContactID] ),
        FILTER ( 'Role', 'Role'[JoinDate] &amp;lt;= _date &amp;amp;&amp;amp; 'Role'[CloseDate] &amp;gt;= _date )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 05:23:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4236219#M167566</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-10T05:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Returning distinct values using a Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4237213#M167597</link>
      <description>&lt;P&gt;Thank you very much for your asistance. This now solves my problem, I wondered if a different approach might be the solution, and you have provided it for me, thank you again.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 15:01:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-distinct-values-using-a-Measure/m-p/4237213#M167597</guid>
      <dc:creator>MattTrollope</dc:creator>
      <dc:date>2024-10-10T15:01:02Z</dc:date>
    </item>
  </channel>
</rss>

