<?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: Measure to count distinct values as 1 over certain period of time range in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3728308#M145253</link>
    <description>&lt;P&gt;Thank you and i tried this formual but it throws an error like The function expects a table expression for arguement ",but a string numeric expression was used and highlights below and says incorrect&lt;/P&gt;&lt;PRE&gt; IN planlist&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2024 17:04:24 GMT</pubDate>
    <dc:creator>dbollini</dc:creator>
    <dc:date>2024-02-27T17:04:24Z</dc:date>
    <item>
      <title>Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3718351#M144777</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate the Distinct count of Colonoscopies for individual patients and i am having couple of issues below is the sample data:&lt;/P&gt;&lt;P&gt;1)Below is the measure i am using to get distinct count but now My measure has to calculate&amp;nbsp; and include the logic to “bundle” records that are within the same &lt;STRONG&gt;72 hour range as 1 count &lt;/STRONG&gt;a&lt;STRONG&gt;nd&lt;/STRONG&gt; then distinict count of colon with start date or health plan id whichever user requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Colonoscopies = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Paid_View&lt;/SPAN&gt;&lt;SPAN&gt;[Health Plan ID]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Paid_View&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Paid_View&lt;/SPAN&gt;&lt;SPAN&gt;[DX_COLONO]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Colonoscopy"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;2)There is a drill through page which i created for this counts but in that drill through report it is showing all the patients in the list though the patient woth Dx_colono= colonscopy should only show but it shows office visits and all patients.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;COUNTY&lt;/TD&gt;&lt;TD&gt;DX&lt;/TD&gt;&lt;TD&gt;DX_COLONO&lt;/TD&gt;&lt;TD&gt;Start Date&lt;/TD&gt;&lt;TD&gt;Health Plan ID&lt;/TD&gt;&lt;TD&gt;Member Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fort Bend&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;4/10/2015 12:00:00 AM&lt;/TD&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;Joe,D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fort Bend&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;4/10/2015 12:00:00 AM&lt;/TD&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;John,D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fort Bend&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;4/10/2015 12:00:00 AM&lt;/TD&gt;&lt;TD&gt;12356&lt;/TD&gt;&lt;TD&gt;John,C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fort Bend&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;Colonoscopy&lt;/TD&gt;&lt;TD&gt;4/21/2015 12:00:00 AM&lt;/TD&gt;&lt;TD&gt;12456&lt;/TD&gt;&lt;TD&gt;David,C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fort Bend&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;4/21/2015 12:00:00 AM&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD&gt;David,F&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fort Bend&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;4/21/2015 12:00:00 AM&lt;/TD&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;Carol,C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me with the correct measure and Drill through issue too thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 16:28:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3718351#M144777</guid>
      <dc:creator>dbollini</dc:creator>
      <dc:date>2024-02-23T16:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3718884#M144789</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="368011" data-lia-user-login="dbollini" class="lia-mention lia-mention-user"&gt;dbollini&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 05:57:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3718884#M144789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-23T05:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3720304#M144855</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the .pbix file in the link below with some test data and please request so i can approve access thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/scl/fo/itl74m733kuqazj98tfjm/h?rlkey=fafzz5m81oojmwm89ngtiox3c&amp;amp;dl=0" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fo/itl74m733kuqazj98tfjm/h?rlkey=fafzz5m81oojmwm89ngtiox3c&amp;amp;dl=0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 16:22:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3720304#M144855</guid>
      <dc:creator>dbollini</dc:creator>
      <dc:date>2024-02-23T16:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3726651#M145168</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="368011" data-lia-user-login="dbollini" class="lia-mention lia-mention-user"&gt;dbollini&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can try to use the following measure formula to get the count of records that include in the records 72 hour ranges:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;formula =
VAR currDate =
    MAX ( Paid_View[Start Date] )
VAR planlist =
    CALCULATE (
        VALUES ( Paid_View[Health Plan ID] ),
        FILTER ( Paid_View, Paid_View[DX_COLONO] = "Colonoscopy" )
    )
RETURN
    CALCULATE (
        COUNT ( Paid_View[Health Plan ID] ),
        FILTER (
            ALLSELECTED ( Paid_View ),
            [Health Plan ID]
                IN planlist
                    &amp;amp;&amp;amp; [Start Date] &amp;gt;= currDate - 3
                    &amp;amp;&amp;amp; [Start Date] &amp;lt;= currDate + 3
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 08:17:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3726651#M145168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-27T08:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3728308#M145253</link>
      <description>&lt;P&gt;Thank you and i tried this formual but it throws an error like The function expects a table expression for arguement ",but a string numeric expression was used and highlights below and says incorrect&lt;/P&gt;&lt;PRE&gt; IN planlist&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 17:04:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3728308#M145253</guid>
      <dc:creator>dbollini</dc:creator>
      <dc:date>2024-02-27T17:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3731256#M145411</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am getting Error below when i am using the code and i trie dto modify with other stuff but same error&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 17:01:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3731256#M145411</guid>
      <dc:creator>dbollini</dc:creator>
      <dc:date>2024-02-28T17:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3742113#M145941</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="368011" data-lia-user-login="dbollini" class="lia-mention lia-mention-user"&gt;dbollini&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can modify the variable to use CALCULATETABLE function, then it can be compared with in operator:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;formula =
VAR currDate =
    MAX ( Paid_View[Start Date] )
VAR planlist =
    CALCULATETABLE (
        VALUES ( Paid_View[Health Plan ID] ),
        FILTER ( Paid_View, Paid_View[DX_COLONO] = "Colonoscopy" )
    )
RETURN
    CALCULATE (
        COUNT ( Paid_View[Health Plan ID] ),
        FILTER (
            ALLSELECTED ( Paid_View ),
            [Health Plan ID]
                IN planlist
                    &amp;amp;&amp;amp; [Start Date] &amp;gt;= currDate - 3
                    &amp;amp;&amp;amp; [Start Date] &amp;lt;= currDate + 3
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 07:45:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3742113#M145941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-05T07:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measure to count distinct values as 1 over certain period of time range</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3744176#M146005</link>
      <description>&lt;P&gt;Thank you for your help !&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 20:50:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-to-count-distinct-values-as-1-over-certain-period-of/m-p/3744176#M146005</guid>
      <dc:creator>dbollini</dc:creator>
      <dc:date>2024-03-05T20:50:25Z</dc:date>
    </item>
  </channel>
</rss>

