<?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: Distinct Count Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394210#M25587</link>
    <description>&lt;P&gt;Thanks again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;&amp;nbsp;I really can't understand why it's not working as expected.&amp;nbsp; Was checking up agains my dataset and for some reason it is counting clients without admission dates/discharge dates as well.....wish I could send you the PBIX, maybe i can work tomorrow to try and clean some data, there's a lot of sensitive information in there so would be tough.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can rewrite the formula and have it count Admission dates rather than individuals and it works (but duplicates some individuals who have more than 1 admission date in the fiscal year) but can't seem to get it to count Distinct Names....Grrr...&lt;/P&gt;</description>
    <pubDate>Thu, 24 Sep 2020 22:30:06 GMT</pubDate>
    <dc:creator>pdoucette</dc:creator>
    <dc:date>2020-09-24T22:30:06Z</dc:date>
    <item>
      <title>Distinct Count Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1393181#M25553</link>
      <description>&lt;P&gt;Hi All, I have the following table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Client&lt;/TD&gt;&lt;TD&gt;Admission Date&lt;/TD&gt;&lt;TD&gt;Discharge Date&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to get the distinct count of clients who were active during a given date range 7/1/19 - 6/30/20.&amp;nbsp; I'm relatively beginger on this so hopefully I'm not way off&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Definition of Active&lt;/STRONG&gt; = Admission Date on or before 6/30/2020 and Discharge is blank or on or after 7/1/19.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Measure I wrote in hopes to obtain this:&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN&gt;FY20 = CALCULATE(DISTINCTCOUNT(ActiveOpen[Client]), FILTER(ActiveOpen, ActiveOpen[Admission Date]&amp;lt;=DATE(2020, 6, 30)&amp;amp;&amp;amp;ISBLANK(ActiveOpen[Discharge Date])||ActiveOpen[Admission Date]&amp;lt;=date(2020, 6, 30)&amp;amp;&amp;amp;ActiveOpen[Discharge Date]&amp;gt;=DATE(2019, 7, 1)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was able to get this formula to work when substituting Distinct count of Client with Count of Admission date but not in the way i had hoped....Often times a client can be active more than once during a time frame if they were &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Admitted---&amp;gt;Discharged----&amp;gt;Readmitted.&amp;nbsp; My hope is to count distinct client names of active clients during the time frame, so a repeaat would be counted once.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 13:24:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1393181#M25553</guid>
      <dc:creator>pdoucette</dc:creator>
      <dc:date>2020-09-24T13:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1393831#M25578</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="176217" data-lia-user-login="pdoucette" class="lia-mention lia-mention-user"&gt;pdoucette&lt;/a&gt;&amp;nbsp; - based on the formula you put in your post, you are missing parenthesis to group the pairs of conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yours&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;       ActiveOpen[Admission Date] &amp;lt;= DATE ( 2020, 6, 30 )
            &amp;amp;&amp;amp; ISBLANK ( ActiveOpen[Discharge Date] )
            || ActiveOpen[Admission Date] &amp;lt;= DATE ( 2020, 6, 30 )
                &amp;amp;&amp;amp; ActiveOpen[Discharge Date] &amp;gt;= DATE ( 2019, 7, 1 )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Corrected&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;       ( ActiveOpen[Admission Date] &amp;lt;= DATE ( 2020, 6, 30 )
            &amp;amp;&amp;amp; ISBLANK ( ActiveOpen[Discharge Date] ) )
            || ( ActiveOpen[Admission Date] &amp;lt;= DATE ( 2020, 6, 30 )
                &amp;amp;&amp;amp; ActiveOpen[Discharge Date] &amp;gt;= DATE ( 2019, 7, 1 ) )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is not the issue, can you give some sample data or your pbix with sensitive data removed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 18:21:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1393831#M25578</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2020-09-24T18:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394143#M25584</link>
      <description>&lt;P&gt;Thank You David, the formula comes up with the same results when entered both ways so I don't think this is the issue.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;|Client |&lt;/TD&gt;&lt;TD&gt;|Admission Date|&lt;/TD&gt;&lt;TD&gt;|Discharge Date|&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Paul&lt;/TD&gt;&lt;TD&gt;7/1/19&lt;/TD&gt;&lt;TD&gt;7/30/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jen&lt;/TD&gt;&lt;TD&gt;7/1/19&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Paul&lt;/TD&gt;&lt;TD&gt;8/30/19&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Steve&lt;/TD&gt;&lt;TD&gt;9/3/19&lt;/TD&gt;&lt;TD&gt;4/1/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Shannon&lt;/TD&gt;&lt;TD&gt;9/5/19&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put some sample data above....my hope would be to have the report negate that Paul is on here twice, and only count him once.....This would be 4 Distinct Individuals Served During the Time frame.....The formula I am using counts Paul Twice.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 21:21:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394143#M25584</guid>
      <dc:creator>pdoucette</dc:creator>
      <dc:date>2020-09-24T21:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394159#M25585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="176217" data-lia-user-login="pdoucette" class="lia-mention lia-mention-user"&gt;pdoucette&lt;/a&gt; - your formula, as written, with the proper grouping, is giving me 4 as it should. I realize that this is "sanitized" data, but perhaps you left something out of your sample data or your table structure/model?&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;Can you share your pbix with sensitive data removed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 21:32:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394159#M25585</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2020-09-24T21:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394210#M25587</link>
      <description>&lt;P&gt;Thanks again&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;&amp;nbsp;I really can't understand why it's not working as expected.&amp;nbsp; Was checking up agains my dataset and for some reason it is counting clients without admission dates/discharge dates as well.....wish I could send you the PBIX, maybe i can work tomorrow to try and clean some data, there's a lot of sensitive information in there so would be tough.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can rewrite the formula and have it count Admission dates rather than individuals and it works (but duplicates some individuals who have more than 1 admission date in the fiscal year) but can't seem to get it to count Distinct Names....Grrr...&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 22:30:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394210#M25587</guid>
      <dc:creator>pdoucette</dc:creator>
      <dc:date>2020-09-24T22:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394234#M25588</link>
      <description>&lt;P&gt;That is just a matter of adding another test in the FILTER statement&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FY20 = 
CALCULATE (
    DISTINCTCOUNT ( ActiveOpen[Client] ),
    FILTER (
        ActiveOpen,
        ( ( ActiveOpen[Admission Date] &amp;lt;= DATE ( 2020, 6, 30 )
            &amp;amp;&amp;amp; ISBLANK ( ActiveOpen[Discharge Date] ) )
            || ( ActiveOpen[Admission Date] &amp;lt;= DATE ( 2020, 6, 30 )
                &amp;amp;&amp;amp; ActiveOpen[Discharge Date] &amp;gt;= DATE ( 2019, 7, 1 ) ) ) &amp;amp;&amp;amp;
                    NOT(ISBLANK(ActiveOpen[Admission Date]) &amp;amp;&amp;amp; ISBLANK(ActiveOpen[Discharge Date]))
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure the NOT surrounds both ISBLANK statements in the last line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2020 23:02:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-Measure/m-p/1394234#M25588</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2020-09-24T23:02:49Z</dc:date>
    </item>
  </channel>
</rss>

