<?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: Filter by date in another Table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4039083#M160135</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;Many thanks for your help, I think we are very close! I think the problem is the data in the table "Transactions" needs to be limited to based on a date held in another table called "Dates".&lt;/P&gt;&lt;P&gt;So Transactions[Date] must be = to or less than DATES[DATE] where DATES[DATE TYPE] = 'Last Close'.&lt;BR /&gt;It might be worth noting that there is no relationsip between these tables, not sure if this causes an issue? I have included images of the tables and the error shown in the DAX formula. Many thanks again!!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4038335#" target="_blank" rel="noopener"&gt;PREVIEW&lt;/A&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&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;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 12 Jul 2024 09:21:37 GMT</pubDate>
    <dc:creator>DDL76</dc:creator>
    <dc:date>2024-07-12T09:21:37Z</dc:date>
    <item>
      <title>DAX: Filter by date in another Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4037938#M160068</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I curently have this DAX formula that works. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FC =&lt;/SPAN&gt; &lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sumx&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Transactions&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Transactions&lt;/SPAN&gt;&lt;SPAN&gt;[Amount]&lt;/SPAN&gt;&lt;SPAN&gt; *&lt;/SPAN&gt;&lt;SPAN&gt;related&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Codes&lt;/SPAN&gt;&lt;SPAN&gt;[Natural Value]&lt;/SPAN&gt;&lt;SPAN&gt;)) ,&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Transactions&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Transactions&lt;/SPAN&gt;&lt;SPAN&gt;[Scenario]&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"Actuals"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However i need to limit the data returned further by the date...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The&amp;nbsp;Transactions[Date] must be equal to or less than the "Last Close" date in the table below called "DATES".&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DATE TYPE&lt;/TD&gt;&lt;TD&gt;DATE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Last Close&lt;/TD&gt;&lt;TD&gt;30/06/2024&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks in advance for your assistance!!!!&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Jul 2024 19:40:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4037938#M160068</guid>
      <dc:creator>DDL76</dc:creator>
      <dc:date>2024-07-11T19:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Filter by date in another Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4038335#M160094</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="774158" data-lia-user-login="DDL76" class="lia-mention lia-mention-user"&gt;DDL76&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FC = 
var _last_date=CALCULATE(MAX('Transactions'[DATE]),FILTER(ALLSELECTED('Transactions'),'Transactions'[DATE TYPE]="Last Close"))

return
Calculate(sumx(Transactions,Transactions[Amount] *related(Codes[Natural Value])) ,FILTER(Transactions,Transactions[Scenario]="Actuals"&amp;amp;&amp;amp;Transactions[Date]&amp;lt;=_last_date  ))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution &lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 02:08:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4038335#M160094</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-12T02:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Filter by date in another Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4039083#M160135</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;Many thanks for your help, I think we are very close! I think the problem is the data in the table "Transactions" needs to be limited to based on a date held in another table called "Dates".&lt;/P&gt;&lt;P&gt;So Transactions[Date] must be = to or less than DATES[DATE] where DATES[DATE TYPE] = 'Last Close'.&lt;BR /&gt;It might be worth noting that there is no relationsip between these tables, not sure if this causes an issue? I have included images of the tables and the error shown in the DAX formula. Many thanks again!!!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4038335#" target="_blank" rel="noopener"&gt;PREVIEW&lt;/A&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&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;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 12 Jul 2024 09:21:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4039083#M160135</guid>
      <dc:creator>DDL76</dc:creator>
      <dc:date>2024-07-12T09:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Filter by date in another Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4041370#M160241</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="774158" data-lia-user-login="DDL76" class="lia-mention lia-mention-user"&gt;DDL76&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please update it.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FC = 
var _last_date=CALCULATE(MAX('DATES'[DATE]),FILTER(ALLSELECTED('DATES'),'DATES'[DATE TYPE]="Last Close"))

return
Calculate(sumx(Transactions,Transactions[Amount] *related(Codes[Natural Value])) ,FILTER(Transactions,Transactions[Scenario]="Actuals"&amp;amp;&amp;amp;Transactions[Date]&amp;lt;=_last_date  ))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 02:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4041370#M160241</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-15T02:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Filter by date in another Table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4042449#M160318</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Neeko Tang, Many thanks its all working as intended! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 11:44:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Filter-by-date-in-another-Table/m-p/4042449#M160318</guid>
      <dc:creator>DDL76</dc:creator>
      <dc:date>2024-07-15T11:44:49Z</dc:date>
    </item>
  </channel>
</rss>

