<?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: [Dax] Count consecutive days and sequence in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481428#M28285</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="269403" data-lia-user-login="Rhaly" class="lia-mention lia-mention-user"&gt;Rhaly&lt;/a&gt; , refer to my blog on Continous Streak can help&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog-Staging-Private/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1290346" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog-Staging-Private/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1290346&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 01:24:50 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-11-09T01:24:50Z</dc:date>
    <item>
      <title>[Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481277#M28273</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm kinda new in Power Pivot and i would ask some help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 columns in my table : Date and ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For each ID, i would like to add 2 columns in power pivot to:&lt;/P&gt;&lt;P&gt;- count consecutive days -&amp;gt; reset to 1 if not consecutive (i tried with earlier but not verfy familiar)&lt;/P&gt;&lt;P&gt;- count sequence&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In excel, i reproduced this table :&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;&lt;BR /&gt;Any help would be grateful&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rhaly&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 20:52:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481277#M28273</guid>
      <dc:creator>Rhaly</dc:creator>
      <dc:date>2020-11-08T20:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481402#M28283</link>
      <description>&lt;P&gt;these code might work in calculated columns&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Sequence=
VAR vPrevTbl =
    FILTER (
        Table1,
        Table1[ID] = EARLIER ( Table1[ID] )
            &amp;amp;&amp;amp; Table1[Date] &amp;lt;= EARLIER ( Table1[Date] )
    )
VAR vPrevDate =
    ADDCOLUMNS (
        vPrevTbl,
        "d",
            VAR vCurrentDate = Table1[Date]
            VAR vCurrentID = Table1[ID]
            VAR vPrevTbl =
                FILTER ( Table1, Table1[Date] &amp;lt;= vCurrentDate &amp;amp;&amp;amp; Table1[ID] = vCurrentID )
            RETURN
                MAXX (
                    FILTER (
                        vPrevTbl,
                        VAR vCD = Table1[Date]
                        VAR r =
                            MAXX ( FILTER ( vPrevTbl, Table1[Date] &amp;lt; vCD ), Table1[Date] )
                        RETURN
                            vcd - 1 &amp;lt;&amp;gt; r
                    ),
                    Table1[Date]
                )
    )
RETURN
    COUNTROWS ( SUMMARIZE ( vprevdate, [d] ) )&lt;/LI-CODE&gt;&lt;LI-CODE lang="cpp"&gt;Count=
VAR vCurrentDate = Table1[Date]
VAR vCurrentID = Table1[ID]
VAR vPrevTbl =
    FILTER ( Table1, Table1[Date] &amp;lt;= vCurrentDate &amp;amp;&amp;amp; Table1[ID] = vCurrentID )
VAR vPrevDate =
    MAXX (
        FILTER (
            vPrevTbl,
            VAR vCD = Table1[Date]
            VAR r =
                MAXX ( FILTER ( vPrevTbl, Table1[Date] &amp;lt; vCD ), Table1[Date] )
            RETURN
                vcd - 1 &amp;lt;&amp;gt; r
        ),
        Table1[Date]
    )
RETURN
    vCurrentDate - vPrevDate + 1&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Nov 2020 01:08:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481402#M28283</guid>
      <dc:creator>wdx223_Daniel</dc:creator>
      <dc:date>2020-11-09T01:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481428#M28285</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="269403" data-lia-user-login="Rhaly" class="lia-mention lia-mention-user"&gt;Rhaly&lt;/a&gt; , refer to my blog on Continous Streak can help&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog-Staging-Private/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1290346" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog-Staging-Private/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1290346&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 01:24:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1481428#M28285</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-11-09T01:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1482138#M28304</link>
      <description>&lt;P&gt;Thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; it works very well&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 08:02:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1482138#M28304</guid>
      <dc:creator>Rhaly</dc:creator>
      <dc:date>2020-11-09T08:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1482149#M28305</link>
      <description>&lt;P&gt;Thank you for your blog. It's very instructive &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 08:06:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1482149#M28305</guid>
      <dc:creator>Rhaly</dc:creator>
      <dc:date>2020-11-09T08:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1502991#M29098</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry to bother you again. The 2 measure works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need now to add a parameter --&amp;gt; On the count measure, i need to not count when it's a sunday and add 1 if both saturday and monday have occurence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understood like 80% of the count measure but i can see where i can add this condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help will be gratefull &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be like this in excel :&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>Wed, 18 Nov 2020 19:10:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/1502991#M29098</guid>
      <dc:creator>Rhaly</dc:creator>
      <dc:date>2020-11-18T19:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/2719982#M82900</link>
      <description>&lt;P&gt;Hi, thank you so much for your help!&amp;nbsp;&lt;BR /&gt;I have a similar challenge but need to ignore weekends.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;on the 11th it is a Monday so it should have 2 instead of 1.&amp;nbsp;&lt;BR /&gt;I have a calendar table but don't know how to adapt the formula.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you so much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 10:53:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/2719982#M82900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-23T10:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: [Dax] Count consecutive days and sequence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/4157827#M165221</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Is there a way to exclude weekends? I've tried using WEEKDAYS not in 1 and 7 but it didn't work. Also my Sequence works just fine but not the Count. My count originally came over as a date. So I only get the count of 1 for each sequence. My count is the column on the right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2024 19:55:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-Count-consecutive-days-and-sequence/m-p/4157827#M165221</guid>
      <dc:creator>nleuck_101</dc:creator>
      <dc:date>2024-09-18T19:55:06Z</dc:date>
    </item>
  </channel>
</rss>

