<?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: Comparing dates between two unrelated fact tables (many to many) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2950247#M97776</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477134" data-lia-user-login="SeanGannon" class="lia-mention lia-mention-user"&gt;SeanGannon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share some sample data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Dec 2022 05:46:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-06T05:46:27Z</dc:date>
    <item>
      <title>Comparing dates between two unrelated fact tables (many to many)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2937272#M96879</link>
      <description>&lt;P&gt;We have two fact tables - Payments and Customer Contacts.&amp;nbsp; We would like to find out how many Payments are made within 6 days of a Customer Contact (a call or email from a collections staff member).&amp;nbsp; Payments and Customer Contacts both relate to DimAccount, and both will have many records for each account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FactPayments&lt;/P&gt;&lt;P&gt;DimAccountID&lt;/P&gt;&lt;P&gt;PaymentDate&lt;/P&gt;&lt;P&gt;PaymentAmount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FactCustomerContact&lt;/P&gt;&lt;P&gt;DimAccountID&lt;/P&gt;&lt;P&gt;DimCampaignID&lt;/P&gt;&lt;P&gt;ContactDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This measure&amp;nbsp;uses TREATAS to force this relationship, this allows be to display both dates together in a table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Payment = &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;Payments&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Payments&lt;/SPAN&gt;&lt;SPAN&gt;[Payment Amount]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;TREATAS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Customer Contacts'&lt;/SPAN&gt;&lt;SPAN&gt;[DimCustomerID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;Payments&lt;/SPAN&gt;&lt;SPAN&gt;[DimCustomerID]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I can't seem to figure out how to filter this measure to only show Payments where the DATEDIFF between these dates is between 0 and 6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Nov 2022 02:24:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2937272#M96879</guid>
      <dc:creator>SeanGannon</dc:creator>
      <dc:date>2022-11-30T02:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates between two unrelated fact tables (many to many)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2937293#M96882</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477134" data-lia-user-login="SeanGannon" class="lia-mention lia-mention-user"&gt;SeanGannon&lt;/a&gt; , one the way is to get the contract date in Fact payment &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a new column&lt;/P&gt;
&lt;P&gt;Con date= maxx(filter(Contract, Contract[DimAccountID] = payment[DimAccountID] &amp;amp;&amp;amp; contract[ContactDate]&amp;lt; Payment[Payment Date]), Payment[Payment Date])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;now you can only work with payment fact&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;countx(filter(payment, payment[Payment Date]&amp;lt;= [con date] +6 &amp;amp;&amp;amp; payment[Payment Date]&amp;gt;= [con date] ), [DimAccountID])&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 02:32:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2937293#M96882</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-11-30T02:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates between two unrelated fact tables (many to many)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2939125#M97000</link>
      <description>&lt;P&gt;There are (potentially) many contacts per payment, won't this force repeating records into FactPayment?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 14:09:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2939125#M97000</guid>
      <dc:creator>SeanGannon</dc:creator>
      <dc:date>2022-11-30T14:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing dates between two unrelated fact tables (many to many)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2950247#M97776</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477134" data-lia-user-login="SeanGannon" class="lia-mention lia-mention-user"&gt;SeanGannon&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share some sample data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 05:46:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-dates-between-two-unrelated-fact-tables-many-to-many/m-p/2950247#M97776</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-06T05:46:27Z</dc:date>
    </item>
  </channel>
</rss>

