<?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: Two inactive relationships between Customer table and Date table not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3453132#M131574</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&lt;/a&gt;&amp;nbsp;, Explain the relationships between tables and how those relationships are working.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Sep 2023 08:11:00 GMT</pubDate>
    <dc:creator>ChiragGarg2512</dc:creator>
    <dc:date>2023-09-29T08:11:00Z</dc:date>
    <item>
      <title>Two inactive relationships between Customer table and Date table not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3452118#M131529</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I have both Customer and Sales tables that I need to have relationships with the Date table.&lt;/P&gt;&lt;P&gt;The Customer table needs two relationships with the Date table for Gain Date and Loss date.&amp;nbsp; The Sales table needs a relation with the date table as well.&lt;/P&gt;&lt;P&gt;So far this is the closest model I have.&amp;nbsp; But it isn't working correctly yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here is my report containing a sales table as well as information about the Gains and Losses of Customers.&lt;/P&gt;&lt;P&gt;Strangely enough the total Losses is correct but the Total Gains are way off.&amp;nbsp; It should be 29.&amp;nbsp; I have tried all the different combinaions of active and inactive relationships as well as DAX but can not get the final piece.&lt;/P&gt;&lt;P&gt;Here is a link to the report.&amp;nbsp; I would appreciate some help with this.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;A href="https://ruralcomputers-my.sharepoint.com/:u:/g/personal/bingraham_rccbi_com/EScqOFoa5uxNsgH68oSEiNIBEGyoURdap6gZ1mFXbwI2OA?e=szmSds" target="_blank"&gt;https://ruralcomputers-my.sharepoint.com/:u:/g/personal/bingraham_rccbi_com/EScqOFoa5uxNsgH68oSEiNIBEGyoURdap6gZ1mFXbwI2OA?e=szmSds&lt;/A&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 16:47:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3452118#M131529</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-09-28T16:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Two inactive relationships between Customer table and Date table not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3453132#M131574</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299232" data-lia-user-login="BudMan512" class="lia-mention lia-mention-user"&gt;BudMan512&lt;/a&gt;&amp;nbsp;, Explain the relationships between tables and how those relationships are working.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 08:11:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3453132#M131574</guid>
      <dc:creator>ChiragGarg2512</dc:creator>
      <dc:date>2023-09-29T08:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Two inactive relationships between Customer table and Date table not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3453501#M131589</link>
      <description>&lt;P&gt;I am attempting to use one Date table&amp;nbsp; for connecting to the Sales table and Customer table.&amp;nbsp; The Date table has an active relationship with Sales.&amp;nbsp; The Customer table is connected with two inactive relationships so I can count the Gain Dates and Loss Dates.&amp;nbsp; This arrangement is not working so I am looking for a way to make it work.&amp;nbsp; I am open to suggestions.&lt;/P&gt;&lt;P&gt;Here is the DAX for the two inactive relationships that I am having a problem with.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Total Gains = COUNTA&lt;SPAN&gt;(Customer[Gain Date])&amp;nbsp; (I don't know how to make this relationship Active)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Losses = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Total Gains]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Customer&lt;/SPAN&gt;&lt;SPAN&gt;[Loss Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)) * -&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks for taking the time to reply.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Sep 2023 12:50:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3453501#M131589</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-09-29T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Two inactive relationships between Customer table and Date table not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3455991#M131739</link>
      <description>&lt;P&gt;I found the answer which uses the function TREATAS.&amp;nbsp; First I removed the inactive relationships.&amp;nbsp; I then used the following DAX, which worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Gains = CALCULATE([Count of Customers],&lt;/P&gt;&lt;P&gt;TREATAS(VALUES('Date'[Date]),Customer[Gain Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Loss = CALCULATE([Count of Customers],&lt;/P&gt;&lt;P&gt;TREATAS(VALUES('Date'[Date]),Customer[Loss Date])) *-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Net Gain/Loss = [Gains]+[Loss]&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 13:30:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Two-inactive-relationships-between-Customer-table-and-Date-table/m-p/3455991#M131739</guid>
      <dc:creator>BudMan512</dc:creator>
      <dc:date>2023-10-02T13:30:04Z</dc:date>
    </item>
  </channel>
</rss>

