<?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: FILTER on second date table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3141877#M112215</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've called the 2 date tables DateC (for the one to go on columns) and DateR (for the one to go on rows)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you create the matrix the filter coming from the column is fine as it is.&amp;nbsp; Your first table is getting you the correct figures per month.&amp;nbsp; The issue is the filter coming from the DateR table, so that's what we want to alter.&lt;/P&gt;
&lt;P&gt;So, this measure alters that filter:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales Triangle = 
CALCULATE(
    SUM(Sales[Amount]),
    DateR[Date] &amp;lt; MIN(DateR[Date])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and gives you this result (my base data is different, hence the different amounts)&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>Mon, 20 Mar 2023 09:04:23 GMT</pubDate>
    <dc:creator>PaulOlding</dc:creator>
    <dc:date>2023-03-20T09:04:23Z</dc:date>
    <item>
      <title>FILTER on second date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3140089#M112077</link>
      <description>&lt;P&gt;Hi community!&lt;/P&gt;
&lt;P&gt;I have a sales table and two date tables. The sales table is linked via Date column to both tables.&lt;/P&gt;
&lt;P&gt;THen I have a matrix with these sales as a value. Then I have Months selected as columns in matrix from the first date table.&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="10%"&gt;Jan&lt;/TD&gt;
&lt;TD width="10%"&gt;Feb&lt;/TD&gt;
&lt;TD width="10%"&gt;Mar&lt;/TD&gt;
&lt;TD width="10%"&gt;Apr&lt;/TD&gt;
&lt;TD width="10%"&gt;May&lt;/TD&gt;
&lt;TD width="10%"&gt;June&lt;/TD&gt;
&lt;TD width="10%"&gt;...&lt;/TD&gt;
&lt;TD width="10%"&gt;...&lt;/TD&gt;
&lt;TD width="10%"&gt;...&lt;/TD&gt;
&lt;TD width="10%"&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;800&lt;/TD&gt;
&lt;TD&gt;900&lt;/TD&gt;
&lt;TD&gt;400&lt;/TD&gt;
&lt;TD&gt;660&lt;/TD&gt;
&lt;TD&gt;405&lt;/TD&gt;
&lt;TD&gt;350&lt;/TD&gt;
&lt;TD&gt;450&lt;/TD&gt;
&lt;TD&gt;...&lt;/TD&gt;
&lt;TD&gt;...&lt;/TD&gt;
&lt;TD&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I would like to add again Months as a row but from the second date table.&lt;/P&gt;
&lt;P&gt;THis selected row determines the last date which should be considered for the matrix:&lt;/P&gt;
&lt;TABLE border="1" width="467px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="40.5781px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="40.5781px"&gt;Jan&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;Feb&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;Mar&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;Apr&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;May&lt;/TD&gt;
&lt;TD width="43.8281px"&gt;June&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;...&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;...&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;...&lt;/TD&gt;
&lt;TD width="42.75px"&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40.5781px"&gt;Feb&lt;/TD&gt;
&lt;TD width="40.5781px"&gt;800&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="43.8281px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.75px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="40.5781px"&gt;Mar&lt;/TD&gt;
&lt;TD width="40.5781px"&gt;800&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;900&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="43.8281px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.6094px"&gt;0&lt;/TD&gt;
&lt;TD width="42.75px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Apr&lt;/TD&gt;
&lt;TD&gt;800&lt;/TD&gt;
&lt;TD&gt;900&lt;/TD&gt;
&lt;TD&gt;400&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would you do that with DAX?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 08:42:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3140089#M112077</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2023-03-18T08:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER on second date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3140190#M112085</link>
      <description>&lt;P&gt;No ideas?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 13:30:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3140190#M112085</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2023-03-18T13:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER on second date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3140673#M112131</link>
      <description>&lt;P&gt;Any ideas? Do you need further information?&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2023 10:11:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3140673#M112131</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2023-03-19T10:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER on second date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3141715#M112204</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) My test data is the same as yours.&lt;/P&gt;
&lt;P&gt;(2)My model relationship is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(3) We can create two measures.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _a = IF(SELECTEDVALUE('CALENDAR Table 2'[Month])&amp;gt;SELECTEDVALUE('CALENDAR Table 1'[Month]) ,
CALCULATE(
    SUM('sale Table'[sales]),
    'CALENDAR Table 2'[Date] &amp;lt; MAX('CALENDAR Table 2'[Date])
),0)
return IF(SELECTEDVALUE('CALENDAR Table 2'[Month]) =1,BLANK(),_a)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(4) Then the result is as follows.&lt;/P&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;helps&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>Tue, 21 Mar 2023 01:37:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3141715#M112204</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-21T01:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: FILTER on second date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3141877#M112215</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've called the 2 date tables DateC (for the one to go on columns) and DateR (for the one to go on rows)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you create the matrix the filter coming from the column is fine as it is.&amp;nbsp; Your first table is getting you the correct figures per month.&amp;nbsp; The issue is the filter coming from the DateR table, so that's what we want to alter.&lt;/P&gt;
&lt;P&gt;So, this measure alters that filter:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sales Triangle = 
CALCULATE(
    SUM(Sales[Amount]),
    DateR[Date] &amp;lt; MIN(DateR[Date])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and gives you this result (my base data is different, hence the different amounts)&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>Mon, 20 Mar 2023 09:04:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FILTER-on-second-date-table/m-p/3141877#M112215</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2023-03-20T09:04:23Z</dc:date>
    </item>
  </channel>
</rss>

