<?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: table with more than one date column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026921#M159028</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739893" data-lia-user-login="miinseon" class="lia-mention lia-mention-user"&gt;miinseon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Your solution is great, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;. Here I have another idea in mind, and I would like to share it for reference.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per your question, I have created simple data&amp;nbsp;:&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you need to get the amount paid one day after the reserve date, we use the following function:&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 =

VAR _date = SELECTEDVALUE('DAX DateTable'[Date]) + 1

VAR _sum = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[payment_date] = _date &amp;amp;&amp;amp; 'Table'[reserve_date] = SELECTEDVALUE('DAX DateTable'[Date])))

RETURN

_sum&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final results are as follows:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&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;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2024 10:45:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-05T10:45:23Z</dc:date>
    <item>
      <title>table with more than one date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026488#M158998</link>
      <description>&lt;P&gt;Hi all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I want to ask a question about a table with more than one date column&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My table has more than one date column.&lt;BR /&gt;I want to get a measure for each date column.&lt;BR /&gt;For example, if I have a reserve date and a payment date, I want to get a measure for the number of bookings and the amount paid in one screen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've included some data from the table below and an example of the screen I'd like to display.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can help me.&lt;BR /&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 07:14:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026488#M158998</guid>
      <dc:creator>miinseon</dc:creator>
      <dc:date>2024-07-05T07:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: table with more than one date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026509#M159001</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739893" data-lia-user-login="miinseon" class="lia-mention lia-mention-user"&gt;miinseon&lt;/a&gt;&amp;nbsp;, You can achieve this using Measure and date table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First create measures&lt;BR /&gt;CountBookingsByReserveDate = COUNTROWS('Bookings')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TotalAmountPaidByPaymentDate = SUM('Bookings'[AmountPaid])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a date table for reserve date go to modelling and new table&lt;/P&gt;
&lt;P&gt;ReserveDateTable = CALENDAR(MIN('Bookings'[ReserveDate]), MAX('Bookings'[ReserveDate]))&lt;/P&gt;
&lt;P&gt;Similarly new table for Payment&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PaymentDateTable = CALENDAR(MIN('Bookings'[PaymentDate]), MAX('Bookings'[PaymentDate]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a relationship between Bookings[ReserveDate] and ReserveDateTable[Date].&lt;/P&gt;
&lt;P&gt;Create a relationship between Bookings[PaymentDate] and PaymentDateTable[Date].&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create visualizations&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 07:25:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026509#M159001</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-07-05T07:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: table with more than one date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026921#M159028</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739893" data-lia-user-login="miinseon" class="lia-mention lia-mention-user"&gt;miinseon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Your solution is great, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;. Here I have another idea in mind, and I would like to share it for reference.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per your question, I have created simple data&amp;nbsp;:&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you need to get the amount paid one day after the reserve date, we use the following function:&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 =

VAR _date = SELECTEDVALUE('DAX DateTable'[Date]) + 1

VAR _sum = CALCULATE(SUM('Table'[price]),FILTER(ALL('Table'),'Table'[payment_date] = _date &amp;amp;&amp;amp; 'Table'[reserve_date] = SELECTEDVALUE('DAX DateTable'[Date])))

RETURN

_sum&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final results are as follows:&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have any other questions please feel free to contact me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Zhu&lt;BR /&gt;Community Support Team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&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;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 10:45:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026921#M159028</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-05T10:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: table with more than one date column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026964#M159034</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739893" data-lia-user-login="miinseon" class="lia-mention lia-mention-user"&gt;miinseon&lt;/a&gt;&amp;nbsp;- To build on the idea from&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;you can also do this with one date table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create base measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CountBookings = COUNTROWS('Bookings')

TotalAmount = SUM('Bookings'[AmountPaid])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then create measures that reference these, but change the context of their calculation by date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CountBookingsByReserveDate = CALCULATE( [CountBookings], USERELATIONSHIP( 'Bookings'[Reserve Date], 'Calendar_table'[Date]))
TotalAmountPaidByReserveDate = CALCULATE( [TotalAmountPaid], USERELATIONSHIP( 'Bookings'[Reserve Date], 'Calendar_table'[Date]))
 
CountBookingsByPaymentDate = CALCULATE( [CountBookings], USERELATIONSHIP( 'Bookings'[Payment Date], 'Calendar_table'[Date]))
TotalAmountPaidByPaymentDate = CALCULATE( [TotalAmountPaid], USERELATIONSHIP( 'Bookings'[Payment Date], 'Calendar_table'[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally these measures will only work once you have created 2 "In-active" relationships from the Calendar table to the respective dates in the Bookings table.&amp;nbsp;&lt;STRONG&gt;Very important to make sure they are both In-active.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark as the solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 11:17:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/table-with-more-than-one-date-column/m-p/4026964#M159034</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-07-05T11:17:05Z</dc:date>
    </item>
  </channel>
</rss>

