<?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: Continuous Streak in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4014815#M158186</link>
    <description>&lt;P&gt;HI,&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="765986" data-lia-user-login="MichelleRA_24" class="lia-mention lia-mention-user"&gt;MichelleRA_24&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;Thank you for your quick reply.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;The following is my updated calculation column, the rest remains unchanged:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF days = 
VAR currentday1=[Vacations Start Date]
VAR predate=CALCULATE(MAX('Table'[Vacations Start Date]),FILTER('Table','Table'[Vacations Start Date]&amp;lt;currentday1))
RETURN IF(NETWORKDAYS(predate,currentday1)=2,1,0)&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;2.Here's my final result, which I hope meets your requirements&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;3.&lt;/SPAN&gt;&lt;SPAN&gt;Here are my related documents, I hope to help you:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/networkdays-function-dax" target="_blank"&gt;&lt;SPAN&gt;NETWORKDAYS function (DAX) - DAX | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;helps&lt;/SPAN&gt;, then please consider Accept it &lt;SPAN&gt;as the solution &lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2024 06:07:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-28T06:07:19Z</dc:date>
    <item>
      <title>Continuous Streak</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4011306#M157884</link>
      <description>&lt;P&gt;Hi to all!&lt;/P&gt;&lt;P&gt;I need your help to create a formula to mark the initial date of each group of consecutive dates and maintain that same date for all dates within each group. It is necessary to use a formula that identifies the start of each group of consecutive dates and marks that date for all rows within the group.&lt;/P&gt;&lt;P&gt;The idea is in the "Vacations Start Date" column, dates are listed, some consecutive and others not.&lt;/P&gt;&lt;P&gt;The "If days" column determines if each date is consecutive with the one above: it marks 0 if not consecutive, and 1 if consecutive.&lt;/P&gt;&lt;P&gt;The "Part" column indicates that for consecutive dates, it shows the same start date where the pattern begins at zero.&lt;/P&gt;&lt;P&gt;The "Count Days" column displays the number of consecutive days, excluding weekends.&lt;/P&gt;&lt;P&gt;Lastly, the "Consecutive days" column repeats the total count of consecutive days for each row&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only have two columns, "Vacations Star Date"&amp;nbsp; and "Return" Could you please guide me on creating the others?&lt;/P&gt;&lt;P&gt;Expected result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&amp;nbsp;&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 13:08:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4011306#M157884</guid>
      <dc:creator>MichelleRA_24</dc:creator>
      <dc:date>2024-06-26T13:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Streak</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4012508#M158012</link>
      <description>&lt;P&gt;HI,&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="765986" data-lia-user-login="MichelleRA_24" class="lia-mention lia-mention-user"&gt;MichelleRA_24&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Regarding the issue you raised, my solution is as follows:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;1. I have created the following table and the column names and data are the data you have given:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;SPAN&gt;First, we need to add a sequence to the powerquery:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;3.&lt;/SPAN&gt;&lt;SPAN&gt;Secondly, use the following calculation column to determine whether it is continuous:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF days = 
VAR currentday1=[Vacations Start Date]
VAR predate=CALCULATE(MAX('Table'[Vacations Start Date]),FILTER('Table','Table'[Vacations Start Date]&amp;lt;currentday1))
RETURN IF(predate+1=currentday1,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;4.Then, relying on the previous calculation column, the grouping column is generated:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;group = 
VAR CurrentIndex1 = [Index]
VAR PreviousIndex1= CALCULATE(MAX('Table'[Index]), FILTER('Table', 'Table'[Index]&amp;lt;=CurrentIndex1 &amp;amp;&amp;amp; 'Table'[IF days]=0))
RETURN PreviousIndex1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;5.You can then proceed to create calculation columns that meet your needs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;RETURN = 'Table'[Vacations Start Date]+1&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Count days = 
VAR CurrentIndex2 = [Index]
VAR PreviousIndex = CALCULATE(MAX('Table'[Index]), FILTER('Table', 'Table'[Index]&amp;lt;=CurrentIndex2 &amp;amp;&amp;amp; 'Table'[IF days]=0))
RETURN IF(ISBLANK(PreviousIndex), 0, (CurrentIndex2 - PreviousIndex))+1&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Consecutive days = 
CALCULATE(MAX('Table'[Count days]),FILTER('Table','Table'[group]=EARLIER('Table'[group])))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Part = 
CALCULATE(MIN('Table'[Vacations Start Date]),FILTER('Table','Table'[group]=EARLIER('Table'[group])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;6.Here's my final result, which I hope meets your requirements.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;It may be noted that November 27 in your case is not consecutive from the previous date, so the expected output result you provided may be wrong in my understanding of your requirements.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;helps&lt;/SPAN&gt;, then please consider Accept it &lt;SPAN&gt;as the solution &lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 04:17:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4012508#M158012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-27T04:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Streak</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4013792#M158094</link>
      <description>&lt;P&gt;Hi Leroy!&lt;/P&gt;&lt;P&gt;Your solution is very good, I´m impressed, thank you very much for dedicating that time. Regarding what you mentioned about November 27, it is correct to count Monday the 27th as consecutive from Friday, as weekends should not be counted as part of consecutive days. That's why the employee took 6 consecutive days despite having a weekend in between. Can this be corrected in the formula?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 15:43:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4013792#M158094</guid>
      <dc:creator>MichelleRA_24</dc:creator>
      <dc:date>2024-06-27T15:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Streak</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4014815#M158186</link>
      <description>&lt;P&gt;HI,&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="765986" data-lia-user-login="MichelleRA_24" class="lia-mention lia-mention-user"&gt;MichelleRA_24&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;Thank you for your quick reply.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;1.&lt;/SPAN&gt;&lt;SPAN&gt;The following is my updated calculation column, the rest remains unchanged:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF days = 
VAR currentday1=[Vacations Start Date]
VAR predate=CALCULATE(MAX('Table'[Vacations Start Date]),FILTER('Table','Table'[Vacations Start Date]&amp;lt;currentday1))
RETURN IF(NETWORKDAYS(predate,currentday1)=2,1,0)&lt;/LI-CODE&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;2.Here's my final result, which I hope meets your requirements&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;3.&lt;/SPAN&gt;&lt;SPAN&gt;Here are my related documents, I hope to help you:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/networkdays-function-dax" target="_blank"&gt;&lt;SPAN&gt;NETWORKDAYS function (DAX) - DAX | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="zh-CN"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Please find the attached pbix relevant to the case.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;SPAN&gt;helps&lt;/SPAN&gt;, then please consider Accept it &lt;SPAN&gt;as the solution &lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 06:07:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4014815#M158186</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-28T06:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Continuous Streak</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4025728#M158929</link>
      <description>&lt;P&gt;Thanks for your time and support.&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 20:43:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Continuous-Streak/m-p/4025728#M158929</guid>
      <dc:creator>MichelleRA_24</dc:creator>
      <dc:date>2024-07-04T20:43:22Z</dc:date>
    </item>
  </channel>
</rss>

