<?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 two dates field in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985607#M12122</link>
    <description>&lt;P&gt;Hi there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I've solved your problem. In the file with the solution, please note that there is bi-filtering enabled between 2 tables, Actions and Action Dates. This is not necessary and should be removed in a full solution but I've put it in there to filter the Action Dates in a slicer for easier navigation. But in a production model, it should be removed and not relied upon unless you know what you are doing, why you are doing it and what the consequences of this are. Otherwise, please stay away from bi-directional filtering as it can be dangerous.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When scrutinizing the solution, please pay attention to the data in the tables. Both date tables are marked as a Date table in the solution to be able to use time-intel functions against them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an outline of how it works. If you don't select any date from Action Date, then you compare [Total Actions] against [Total Actions PY] in the usual way. When you filter by dates in Action Date, then not only [Creation Dates] are shifted back one year for comparison but also Action Dates. This I believe is how you wanted it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://1drv.ms/u/s!ApyQEauTSLtOgYM98Uqy2CW0t8Whmg?e=3tjIAg" target="_blank" rel="noopener"&gt;https://1drv.ms/u/s!ApyQEauTSLtOgYM98Uqy2CW0t8Whmg?e=3tjIAg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Sun, 22 Mar 2020 10:43:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-22T10:43:23Z</dc:date>
    <item>
      <title>Table with two dates field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/977636#M11849</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a fact table with two dates field, creation and action. (many rows here only and example)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Creation&lt;/TD&gt;&lt;TD&gt;ActionDate&lt;/TD&gt;&lt;TD&gt;NumberOfActions&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/02/2020&lt;/TD&gt;&lt;TD&gt;26/02/2020&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01/02/2020&lt;/TD&gt;&lt;TD&gt;27/02/2020&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02/02/2020&lt;/TD&gt;&lt;TD&gt;03/02/2020&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is sample data, we have N Action Date by 1 Creation Date summarize in the Numbe Of Actions&lt;/P&gt;&lt;P&gt;We want to build a char, X Axis withe creation Date, Y axis number of actions (this year and last year), filtered by a Action Date Slicer&lt;/P&gt;&lt;P&gt;In the visual we want to make a comparation with Last Year number of actions.&lt;/P&gt;&lt;P&gt;Using the sameperiodlastyear works for last year, but using the filter of Action Date Filter obviously filters the data to this days , and it only shows actions of last year to the action date in the filter, how do we apply the same comparation of Last Year Creations and same Action Date Last Year?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P class="ics-element-donot-delete 1001_CC@"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 08:55:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/977636#M11849</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-17T08:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Table with two dates field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985498#M12118</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can make use of a calendar table with dual relationships(one active and another inactive):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Then you can use measures USERELATIONSHIP with CALCULATE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Orders by Order Date = SUM(dtOrders[Order Quantity])

Orders by Ship Date =
CALCULATE (
    dtOrders[Orders by Order Date],
    USERELATIONSHIP ( dtOrders[Ship Date], dtCalendar[Date] )
)

Orders (SD - PY) =
CALCULATE (
    dtOrders[Orders by Ship Date],
    SAMEPERIODLASTYEAR ( dtCalendar[Date] )
)
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can use these measures in your visuals:&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;Sample solution file &lt;A href="https://vivranin-my.sharepoint.com/:u:/g/personal/vivek_ranjan_vivran_in/ETBMIvipKuRMpMPWMBshCd8B9rf_oH2Zt4H6o0v6F5ffQQ?e=Vba9ZI" target="_blank" rel="noopener"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;BR /&gt;Vivek&lt;BR /&gt;&lt;BR /&gt;If it helps, please mark it as a solution&lt;BR /&gt;Kudos would be a cherry on the top &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.vivran.in/" target="_blank"&gt;https://www.vivran.in/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/vivek-ranjan-063a1a17b/" target="_blank"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 06:09:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985498#M12118</guid>
      <dc:creator>vivran22</dc:creator>
      <dc:date>2020-03-22T06:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Table with two dates field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985607#M12122</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I've solved your problem. In the file with the solution, please note that there is bi-filtering enabled between 2 tables, Actions and Action Dates. This is not necessary and should be removed in a full solution but I've put it in there to filter the Action Dates in a slicer for easier navigation. But in a production model, it should be removed and not relied upon unless you know what you are doing, why you are doing it and what the consequences of this are. Otherwise, please stay away from bi-directional filtering as it can be dangerous.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When scrutinizing the solution, please pay attention to the data in the tables. Both date tables are marked as a Date table in the solution to be able to use time-intel functions against them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an outline of how it works. If you don't select any date from Action Date, then you compare [Total Actions] against [Total Actions PY] in the usual way. When you filter by dates in Action Date, then not only [Creation Dates] are shifted back one year for comparison but also Action Dates. This I believe is how you wanted it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://1drv.ms/u/s!ApyQEauTSLtOgYM98Uqy2CW0t8Whmg?e=3tjIAg" target="_blank" rel="noopener"&gt;https://1drv.ms/u/s!ApyQEauTSLtOgYM98Uqy2CW0t8Whmg?e=3tjIAg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2020 10:43:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985607#M12122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-22T10:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Table with two dates field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985610#M12123</link>
      <description>Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="141768" data-lia-user-login="vivran22" class="lia-mention lia-mention-user"&gt;vivran22&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;One calendar in the solution will not achieve what's required. You have to have 2 of them out of necessity.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Sun, 22 Mar 2020 10:44:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Table-with-two-dates-field/m-p/985610#M12123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-22T10:44:36Z</dc:date>
    </item>
  </channel>
</rss>

