<?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 Total count based on the recurrence of the same event within a speficic time period. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4130598#M164062</link>
    <description>&lt;P&gt;Hi&amp;nbsp; All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to find the total count based on the recurrence of the same event within a period.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ID diseases diseases date&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D1 22-06-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 D2 25-06-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 D2 26-06-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 D3 22-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D4 22-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 D4 27-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 D2 27-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D1 22-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D2 22-05-2024&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count ID Count&lt;BR /&gt;7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 {D1, D1} ,D2, D4 -(3) As D1 recurrence within 60 days.&lt;/P&gt;&lt;P&gt;2 D2 , D4 - 2&lt;/P&gt;&lt;P&gt;3 {D2,D2,}, D3 -2 As D2 recurrence within 60 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2024 16:27:58 GMT</pubDate>
    <dc:creator>Puja_Kumari25</dc:creator>
    <dc:date>2024-09-03T16:27:58Z</dc:date>
    <item>
      <title>Total count based on the recurrence of the same event within a speficic time period.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4130598#M164062</link>
      <description>&lt;P&gt;Hi&amp;nbsp; All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me to find the total count based on the recurrence of the same event within a period.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ID diseases diseases date&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D1 22-06-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 D2 25-06-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 D2 26-06-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 D3 22-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D4 22-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 D4 27-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 D2 27-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D1 22-07-2024&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 D2 22-05-2024&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count ID Count&lt;BR /&gt;7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 {D1, D1} ,D2, D4 -(3) As D1 recurrence within 60 days.&lt;/P&gt;&lt;P&gt;2 D2 , D4 - 2&lt;/P&gt;&lt;P&gt;3 {D2,D2,}, D3 -2 As D2 recurrence within 60 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 16:27:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4130598#M164062</guid>
      <dc:creator>Puja_Kumari25</dc:creator>
      <dc:date>2024-09-03T16:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Total count based on the recurrence of the same event within a speficic time period.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4130610#M164065</link>
      <description>&lt;P&gt;Sample data be like&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example&amp;nbsp; :&lt;/P&gt;&lt;P&gt;ID diseases diseases date&lt;BR /&gt;1 D1 22-06-2024&lt;BR /&gt;2 D2 25-06-2024&lt;BR /&gt;3 D2 26-06-2024&lt;BR /&gt;3 D3 22-07-2024&lt;BR /&gt;1 D4 22-07-2024&lt;BR /&gt;2 D4 27-07-2024&lt;BR /&gt;3 D2 27-07-2024&lt;BR /&gt;1 D1 22-07-2024&lt;BR /&gt;1 D2 22-05-2024&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 07:07:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4130610#M164065</guid>
      <dc:creator>Puja_Kumari25</dc:creator>
      <dc:date>2024-09-03T07:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Total count based on the recurrence of the same event within a speficic time period.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4131220#M164085</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="471932" data-lia-user-login="Puja_Kumari25" class="lia-mention lia-mention-user"&gt;Puja_Kumari25&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please elaborate your desired output. Not able to understand the the current format.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 12:21:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4131220#M164085</guid>
      <dc:creator>Rupak_bi</dc:creator>
      <dc:date>2024-09-03T12:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Total count based on the recurrence of the same event within a speficic time period.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4131715#M164113</link>
      <description>&lt;P&gt;We need to create a measure to&amp;nbsp; total count&amp;nbsp; but condition is that for the same id , same event (like D1,D2 ) occur within a specific date its count only one.&amp;nbsp; here is total count of rows is 9, but output form mesure should be 7.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 16:30:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4131715#M164113</guid>
      <dc:creator>Puja_Kumari25</dc:creator>
      <dc:date>2024-09-03T16:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Total count based on the recurrence of the same event within a speficic time period.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4132622#M164145</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="471932" data-lia-user-login="Puja_Kumari25" class="lia-mention lia-mention-user"&gt;Puja_Kumari25&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;P&gt;Here is the sample table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MEASURE =
VAR _vtable =
    ADDCOLUMNS (
        'Table',
        "_Datediff",
            DATEDIFF (
                CALCULATE (
                    MAX ( 'Table'[diseases date] ),
                    FILTER (
                        ALLSELECTED ( 'Table' ),
                        'Table'[diseases date] &amp;lt; EARLIER ( 'Table'[diseases date] )
                            &amp;amp;&amp;amp; 'Table'[diseases] = EARLIER ( 'Table'[diseases] )
                            &amp;amp;&amp;amp; 'Table'[ID] = EARLIER ( 'Table'[ID] )
                    )
                ),
                'Table'[diseases date],
                DAY
            )
    )
RETURN
    COUNTROWS (
        SUMMARIZE (
            FILTER ( _vtable, [_Datediff] &amp;gt;= 60 ),
            'Table'[ID],
            'Table'[diseases]
        )
    )
        + COUNTROWS (
            SUMMARIZE (
                FILTER ( _vtable, [_Datediff] &amp;lt; 60 ),
                'Table'[ID],
                'Table'[diseases]
            )
        )
&lt;/LI-CODE&gt;
&lt;P&gt;The result is as follow:&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;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&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;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 06:10:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4132622#M164145</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-09-04T06:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Total count based on the recurrence of the same event within a speficic time period.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4142556#M164634</link>
      <description>&lt;P&gt;Thank you for sharing the solution.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 10:23:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Total-count-based-on-the-recurrence-of-the-same-event-within-a/m-p/4142556#M164634</guid>
      <dc:creator>Puja_Kumari25</dc:creator>
      <dc:date>2024-09-10T10:23:07Z</dc:date>
    </item>
  </channel>
</rss>

