<?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: COUNT and USERELATIONSHIP Issue in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1872493#M40161</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="287873" data-lia-user-login="omd001" class="lia-mention lia-mention-user"&gt;omd001&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use the FILTER as an argument for CALCULATE and just count the rows of the basic table. This will be filtered by the arguments in CALCULATE.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So try the following approach:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Completed =
CALCULATE(
    COUNTROWS( 'FACT Project' ),
    FILTER(
        'FACT Project',
        'FACT Project'[Status] = "Completed"
    ),
    USERELATIONSHIP ( 'DIM Dates'[Date], 'FACT Project'[Actual Completion Date] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;If you need any help please let me know.&lt;/DIV&gt;&lt;DIV&gt;If I answered your question I would be happy if you could mark my post as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; and give it a thumbs up &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Best regards&lt;/DIV&gt;&lt;DIV&gt;Denis&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Blog: &lt;A title="Click here!" href="https://whatthefact.bi/?utm_source=powerbicommunity&amp;amp;utm_medium=link&amp;amp;utm_campaign=forum" target="_blank" rel="noopener"&gt;&lt;U&gt;WhatTheFact.bi&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;Follow me: &lt;A title="Click here!" href="https://twitter.com/DenSelimovic" target="_blank" rel="noopener"&gt;&lt;U&gt;twitter.com/DenSelimovic&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 31 May 2021 08:29:04 GMT</pubDate>
    <dc:creator>selimovd</dc:creator>
    <dc:date>2021-05-31T08:29:04Z</dc:date>
    <item>
      <title>COUNT and USERELATIONSHIP Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1872190#M40157</link>
      <description>&lt;P&gt;I would like to count the number of projects with status "Completed" based on an inactive date relationship "Actual Completion Date".&lt;BR /&gt;&lt;BR /&gt;I used the following command:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Completed =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS(FILTER('FACT Project','FACT Project'[Status] = "Completed")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USERELATIONSHIP('DIM Dates'[Date],'FACT Project'[Actual Completion Date]))+0&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;It's returning me 0 instead of 14 as a count for the month of May.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 May 2021 06:58:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1872190#M40157</guid>
      <dc:creator>omd001</dc:creator>
      <dc:date>2021-05-31T06:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT and USERELATIONSHIP Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1872493#M40161</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="287873" data-lia-user-login="omd001" class="lia-mention lia-mention-user"&gt;omd001&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use the FILTER as an argument for CALCULATE and just count the rows of the basic table. This will be filtered by the arguments in CALCULATE.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So try the following approach:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Completed =
CALCULATE(
    COUNTROWS( 'FACT Project' ),
    FILTER(
        'FACT Project',
        'FACT Project'[Status] = "Completed"
    ),
    USERELATIONSHIP ( 'DIM Dates'[Date], 'FACT Project'[Actual Completion Date] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;If you need any help please let me know.&lt;/DIV&gt;&lt;DIV&gt;If I answered your question I would be happy if you could mark my post as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; and give it a thumbs up &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Best regards&lt;/DIV&gt;&lt;DIV&gt;Denis&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Blog: &lt;A title="Click here!" href="https://whatthefact.bi/?utm_source=powerbicommunity&amp;amp;utm_medium=link&amp;amp;utm_campaign=forum" target="_blank" rel="noopener"&gt;&lt;U&gt;WhatTheFact.bi&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;Follow me: &lt;A title="Click here!" href="https://twitter.com/DenSelimovic" target="_blank" rel="noopener"&gt;&lt;U&gt;twitter.com/DenSelimovic&lt;/U&gt;&lt;/A&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 31 May 2021 08:29:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1872493#M40161</guid>
      <dc:creator>selimovd</dc:creator>
      <dc:date>2021-05-31T08:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT and USERELATIONSHIP Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1873791#M40209</link>
      <description>&lt;P&gt;Thanks Denis.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It's strange that it only returned 2 rows of data and I am expecting more. I have no filters causing this so I wonder why it is not returning the expected results.&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;</description>
      <pubDate>Tue, 01 Jun 2021 00:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1873791#M40209</guid>
      <dc:creator>omd001</dc:creator>
      <dc:date>2021-06-01T00:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT and USERELATIONSHIP Issue</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1874204#M40216</link>
      <description>&lt;P&gt;Hi Denis,&lt;/P&gt;&lt;P&gt;I've managed to fix the issue using a different approach and it worked!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Completed = CALCULATE([Total Projects], 'FACT Project'[Status]="Completed", USERELATIONSHIP('DIM Dates'[Date], 'FACT Project'[Actual Completion Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I basically created a new measure to count all the projects first, and thereafter filter it with the status then use the inactive relationship.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 05:54:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/COUNT-and-USERELATIONSHIP-Issue/m-p/1874204#M40216</guid>
      <dc:creator>omd001</dc:creator>
      <dc:date>2021-06-01T05:54:25Z</dc:date>
    </item>
  </channel>
</rss>

