<?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 Adding a new Dax Column to show the next appointment date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329126#M58444</link>
    <description>&lt;P&gt;Here is the appointment table I have.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a column that shows the next appointment date. Below is how it should look like. Please give me some hints.&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;</description>
    <pubDate>Wed, 09 Feb 2022 20:18:28 GMT</pubDate>
    <dc:creator>TonyGu</dc:creator>
    <dc:date>2022-02-09T20:18:28Z</dc:date>
    <item>
      <title>Adding a new Dax Column to show the next appointment date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329126#M58444</link>
      <description>&lt;P&gt;Here is the appointment table I have.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add a column that shows the next appointment date. Below is how it should look like. Please give me some hints.&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;</description>
      <pubDate>Wed, 09 Feb 2022 20:18:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329126#M58444</guid>
      <dc:creator>TonyGu</dc:creator>
      <dc:date>2022-02-09T20:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new Dax Column to show the next appointment date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329155#M58447</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How the next column should be related to the rest of the table ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't you just add the information in the source table ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 20:48:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329155#M58447</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-09T20:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new Dax Column to show the next appointment date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329175#M58450</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="259621" data-lia-user-login="TonyGu" class="lia-mention lia-mention-user"&gt;TonyGu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this one work for you?&lt;/P&gt;&lt;PRE&gt;Next Appointment Date = 
VAR _currentDate = Table[Appointment Date] 
RETURN
CALCULATE ( 
    MIN ( Table[Appointment Date] ), 
    ALLEXCEPT ( Table, Table[ClientID] ),
    'Table'[Appointment Date] &amp;gt; _currentDate 
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could also create an index to get the correct order, i.e. in Power Query, and then loop over them. Your AppointmentID might already exactly be that, then you could do something like this:&lt;/P&gt;&lt;PRE&gt;Next Appointment Date = 
VAR _currentIndex = Table[AppointmentID] 
RETURN
CALCULATE ( 
    MIN ( Table[Appointment Date] ), 
    'Table'[AppointmentID] = _currentIndex + 1 
)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Hope this gets you closer to a solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;/Tom&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.tackytech.blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.instagram.com/tackytechtom&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 21:02:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329175#M58450</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-02-09T21:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new Dax Column to show the next appointment date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329252#M58453</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried your dax and it works. Thanks a lot! Now I have another question. This time the table includes a status column. For those status is "False, I don't want to include that. The table should look like this. I wonder how to add that filter to the dax you have written.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 21:54:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329252#M58453</guid>
      <dc:creator>TonyGu</dc:creator>
      <dc:date>2022-02-09T21:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new Dax Column to show the next appointment date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329274#M58455</link>
      <description>&lt;P&gt;No worry. I figure out my self. Here is the DAX I wrote.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NPD = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_currentDate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Appointment[Appointment Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Appointment[Status]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Appointment[Appointment Date]&lt;/SPAN&gt;&lt;SPAN&gt; ), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;Appointment&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Appointment[ClientID]&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Appointment[Appointment Date]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;_currentDate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Appointment[Status]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"True"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Feb 2022 21:59:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329274#M58455</guid>
      <dc:creator>TonyGu</dc:creator>
      <dc:date>2022-02-09T21:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a new Dax Column to show the next appointment date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329296#M58457</link>
      <description>&lt;P&gt;Awesome! Well done!&lt;BR /&gt;&lt;BR /&gt;Don't forget to mark the answer to your initial question as a solution. Then it will be easier for others to find it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;/Tom&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.tackytech.blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.instagram.com/tackytechtom&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 22:06:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-a-new-Dax-Column-to-show-the-next-appointment-date/m-p/2329296#M58457</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-02-09T22:06:34Z</dc:date>
    </item>
  </channel>
</rss>

