<?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 Min and Max Date between two tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944008#M97335</link>
    <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new to DAX and I need a little help in solving an issue. Here my situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 tables:&lt;/P&gt;&lt;P&gt;- PROJECT: project ID&lt;/P&gt;&lt;P&gt;- LEDGER LINES: posting date, project id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired outcome in table PROJECT: project ID, earlest date, latest date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically want to create 2 calculated columns in table project showing me earliest and latest activity in the project. Any help with the formulas I need for these 2 columns? Thanks!!&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 08:39:56 GMT</pubDate>
    <dc:creator>allejot</dc:creator>
    <dc:date>2022-12-02T08:39:56Z</dc:date>
    <item>
      <title>Min and Max Date between two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944008#M97335</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new to DAX and I need a little help in solving an issue. Here my situation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 tables:&lt;/P&gt;&lt;P&gt;- PROJECT: project ID&lt;/P&gt;&lt;P&gt;- LEDGER LINES: posting date, project id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Desired outcome in table PROJECT: project ID, earlest date, latest date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically want to create 2 calculated columns in table project showing me earliest and latest activity in the project. Any help with the formulas I need for these 2 columns? Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:39:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944008#M97335</guid>
      <dc:creator>allejot</dc:creator>
      <dc:date>2022-12-02T08:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Min and Max Date between two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944207#M97350</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="241390" data-lia-user-login="allejot" class="lia-mention lia-mention-user"&gt;allejot&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;As per your question I have created the below table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Create a new column as&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Earliest date = &lt;SPAN&gt;CALCULATE&lt;SPAN&gt;(&lt;SPAN&gt;Min&lt;SPAN&gt;(&lt;SPAN&gt;'LEDGER LINES'&lt;SPAN&gt;[posting date]&lt;SPAN&gt;),&lt;SPAN&gt;FILTER&lt;SPAN&gt;(&lt;SPAN&gt;'LEDGER LINES'&lt;SPAN&gt;,&lt;SPAN&gt;'LEDGER LINES'&lt;SPAN&gt;[Project Id]&lt;SPAN&gt;=&lt;SPAN&gt;project&lt;SPAN&gt;[Project id]&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;2. Create a new column as&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Latest date = &lt;SPAN&gt;CALCULATE&lt;SPAN&gt;(&lt;SPAN&gt;MAX&lt;SPAN&gt;('LEDGER LINES'[posting date]),&lt;SPAN&gt;FILTER&lt;SPAN&gt;('LEDGER LINES','LEDGER LINES'[Project Id]=project[Project id]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Results:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Shreya&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Did I answer your question? Mark my post as a solution!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 09:45:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944207#M97350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-02T09:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Min and Max Date between two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944296#M97356</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="241390" data-lia-user-login="allejot" class="lia-mention lia-mention-user"&gt;allejot&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;i would recommend creating a relationship between the two tables.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;After this you can easily create your columns with the earliest and the latest date.&lt;BR /&gt;Therfore create a new column in the Project Table.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;EarliesteDate = &lt;/SPAN&gt;&lt;SPAN&gt;MINX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Ledger Lines'&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;'Ledger Lines'[PostingDate]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;LatestDate = MAXX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;RELATEDTABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Ledger Lines'&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;'Ledger Lines'[PostingDate]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;In this solution you are using something wichich is called "Row context". It is a very import thing within DAX.&amp;nbsp;&lt;BR /&gt;I hope this will help you.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Best Regards&amp;nbsp;&lt;BR /&gt;_MG_&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 10:10:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Min-and-Max-Date-between-two-tables/m-p/2944296#M97356</guid>
      <dc:creator>_MG_</dc:creator>
      <dc:date>2022-12-02T10:10:52Z</dc:date>
    </item>
  </channel>
</rss>

