<?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 Date table with multi relationships in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/698790#M751</link>
    <description>&lt;P&gt;I am hoping for some help with date tables - i'm new to PowerBI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table, with 4 main date fields - add_date, Won_date, lost_date and latest_date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to report revenue based on the first three date. I have been using the USERELATIONSHIP function to switch relationships and this seems to be working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the revenue value is the base currency rather than GBP, which is causing me the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an exchange rate table, which is looking up the currency and latest_date for the correct ex-rate rate.&lt;/P&gt;&lt;P&gt;However, as they are using the same date table, it's not working, as we can only change the active relationship one it seems. I have got around this introducing a second date table, linking the Latest_date to this date table. However, this doesn't feel like best practice having multi date tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 21:22:55 GMT</pubDate>
    <dc:creator>gwright15</dc:creator>
    <dc:date>2019-05-23T21:22:55Z</dc:date>
    <item>
      <title>Date table with multi relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/698790#M751</link>
      <description>&lt;P&gt;I am hoping for some help with date tables - i'm new to PowerBI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table, with 4 main date fields - add_date, Won_date, lost_date and latest_date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to report revenue based on the first three date. I have been using the USERELATIONSHIP function to switch relationships and this seems to be working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the revenue value is the base currency rather than GBP, which is causing me the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an exchange rate table, which is looking up the currency and latest_date for the correct ex-rate rate.&lt;/P&gt;&lt;P&gt;However, as they are using the same date table, it's not working, as we can only change the active relationship one it seems. I have got around this introducing a second date table, linking the Latest_date to this date table. However, this doesn't feel like best practice having multi date tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 21:22:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/698790#M751</guid>
      <dc:creator>gwright15</dc:creator>
      <dc:date>2019-05-23T21:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Date table with multi relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/699796#M768</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="138622" data-lia-user-login="gwright15" class="lia-mention lia-mention-user"&gt;gwright15&lt;/a&gt; based on your input, you don't need 2nd date table, you are correct that you can have only one active relationship, it is if you are connecting same table on multiple dates, which you are already doing and using&amp;nbsp;&lt;EM&gt;userrelationship&lt;/EM&gt; function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should able to have active relationship between your date table and fx rate table, not sure why you are not able to create active relationship between these two tables.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 13:11:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/699796#M768</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-25T13:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Date table with multi relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/701312#M807</link>
      <description>&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anything look wrong with this code, which would prevent these relationship working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Exchange Rate = 
VAR
    RevisedDate = Filter( All(Date_Ex_Rate[Date]),
                            Date_Ex_Rate[Date] &amp;gt; Max ( Date_Ex_Rate[Date] ) -5 &amp;amp;&amp;amp; Date_Ex_Rate[Date] &amp;lt;= Max(Date_Ex_Rate[Date] ) )

RETURN

Calculate (Exchange_Rates_GBP[Ex-Rate],
LASTNONBLANK(RevisedDate, Exchange_Rates_GBP[Ex-Rate]),USERELATIONSHIP('Date'[Date],Date_Ex-Rate[Date])
)&lt;/PRE&gt;&lt;PRE&gt;Deal_Value_Add_Time = Calculate(sum(deals[value]),USERELATIONSHIP('Date'[Date],deals[Add_Time_Local]),USERELATIONSHIP(deals[user_id],users[id]),NOT(deals[status]="deleted"))&lt;/PRE&gt;&lt;PRE&gt;Deal_Value_Add_Time_GBP = Sumx(deals,deals[Deal_Value_Add_Time]/Exchange_Rates_GBP[Exchange Rate])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 10:54:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/701312#M807</guid>
      <dc:creator>gwright15</dc:creator>
      <dc:date>2019-05-28T10:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Date table with multi relationships</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/701508#M814</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="138622" data-lia-user-login="gwright15" class="lia-mention lia-mention-user"&gt;gwright15&lt;/a&gt; if you can share sample pbix/data will make it easy to look into it.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 14:54:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-table-with-multi-relationships/m-p/701508#M814</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-28T14:54:55Z</dc:date>
    </item>
  </channel>
</rss>

