<?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: Translate foreign currency transactions based on selected date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696041#M679</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; add following column in your fact to get FX rate of that month and then it is pretty easy from there. You &lt;U&gt;don't need relationship&lt;/U&gt; between DIM_RATES and FACT tabe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;FxRate = 
LOOKUPVALUE(
    DIM_RATES[FX Rate],
    DIM_RATES[Period],
    EOMONTH( FACT_TRANSACTIONS[[PostingDate]]], -1 ) + 1,
    DIM_RATES[Currency],
    FACT_TRANSACTIONS[[Currency]]]
)&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 May 2019 14:12:30 GMT</pubDate>
    <dc:creator>parry2k</dc:creator>
    <dc:date>2019-05-21T14:12:30Z</dc:date>
    <item>
      <title>Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/695942#M672</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a model that features several difference currencies stretching back over the last 5 years or so and I have a requirement to display these transactions in GBP at a given date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data model consists of a fact table which contains the list of transactions and two dimension tables - one for dates and the other for FX rates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to be able to do is pick dates from the calendar and the model to then convert all foreign currency transactions into GBP based on the date selected. For example, if I select all transactions up to the end of April 2019 then I need the model to sum all transactions by currency and then pick the prevailing FX for each currency for April 2019. Likewise, if I selected July 2018 then I would need it to pick up all relevant transactions and convert at the July 2018 rate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its also worth noting that whilst the transactions are booked up on a daily basis, there is only one FX rate for each month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm farily new to DAX so looking for some advise please! Screenshots of data model uploaded below.&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;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 12:44:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/695942#M672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-21T12:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/695959#M674</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; Can you please share sample data in excel using onedrive/google drive to get your answer quickly. Remove any sensitive information before sharing.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:08:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/695959#M674</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-21T13:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696016#M678</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp; Thanks - link below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/s/0thd8idz6fgkmph/Sample%20Data.xlsx?dl=0" target="_blank" rel="noopener"&gt;Sample Data&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:52:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696016#M678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-21T13:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696041#M679</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; add following column in your fact to get FX rate of that month and then it is pretty easy from there. You &lt;U&gt;don't need relationship&lt;/U&gt; between DIM_RATES and FACT tabe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;FxRate = 
LOOKUPVALUE(
    DIM_RATES[FX Rate],
    DIM_RATES[Period],
    EOMONTH( FACT_TRANSACTIONS[[PostingDate]]], -1 ) + 1,
    DIM_RATES[Currency],
    FACT_TRANSACTIONS[[Currency]]]
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 14:12:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696041#M679</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-21T14:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696061#M681</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;Thanks for your help but unforunately that doesn't quite give me what I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To clarify my requirement, if I select all transactions between Jan - Apr 2019 then I need the model to sum all transactions in their original currencies and then convert the total using April 2019 rates. Taking the example further, if I then selected all transactions between Jan and Feb then I'd need the model to sum all transactions between those dates in their base currencies and convert at the Feb rates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an example of what I'm looking to achieve using the sample data. The data is filtered for all transactions between Jan - Mar for CNY currency, the FX rate is the Mar CNY rate and the GBP Value column is just column O divided by the FX rate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 14:29:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696061#M681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-21T14:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696095#M684</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; thst is even easier, basically you are saying use the most recent selected month for fx rate not the month in which transactoin happened.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 15:02:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696095#M684</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-21T15:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696097#M685</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp; Yes :) I did say I was new to DAX&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 15:04:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696097#M685</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-21T15:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696210#M696</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; use following expression to add as &lt;STRONG&gt;measure&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;FxRate as Measure = 
VAR __month = CALCULATE( MAX( 'Date'[Date] ), ALLSELECTED( 'Date'[Date] ) )
VAR __firstofMonth = EOMONTH( __month, -1 ) + 1
VAR __currency = MAX( FACT_TRANSACTIONS[[Currency]]] )
RETURN
CALCULATE( MAX( DIM_RATES[FX Rate] ), DIM_RATES[Period] = __firstofMonth, DIM_RATES[Currency] = __currency )
&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 16:34:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696210#M696</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-21T16:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696954#M705</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;I created a new measure and it correctly returns the rate if I select all April dates, however when I select March I don't get the March rate:&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;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 08:39:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/696954#M705</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T08:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697057#M706</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; I'm not sure wht is going on there, I tested on my end on test data you provided and it works fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 09:52:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697057#M706</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-22T09:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697231#M710</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;thats odd - I had to make a small change to the code to resolve an error, but I don't think it would be causing an issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;=
VAR __month = CALCULATE( MAX( DIM_CALENDAR[Date] ), ALLSELECTED( DIM_CALENDAR[Date] ) )
VAR __firstofMonth = EOMONTH( __month, -1 ) + 1
VAR __currency = MAX(FACT_TRANSACTIONS[Currency] )
RETURN
CALCULATE( MAX( DIM_RATES[FX Rate] ), DIM_RATES[Period] = __firstofMonth, DIM_RATES[Currency] = __currency )&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 May 2019 13:02:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697231#M710</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T13:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697256#M711</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; so it is resolved or what?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 13:22:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697256#M711</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-22T13:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697258#M712</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;no its still not working, just showing the changes I made to the code in the off chance you saw an error&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 13:24:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697258#M712</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T13:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697284#M713</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;each of the variables are pulling through the correct data, it seems to be the formula that's causing the issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 13:40:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697284#M713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T13:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697303#M714</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp; I've just tried the measure on the sample data I shared and it works, but not on the live data. The only difference between the two is that the live data contains transactions going back over several years, so there is older data in the fact table and the calendar obviously has more dates too (the FX table is identical). That said, having gone through the formula behind the measure I'm not sure what difference this would make?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 13:55:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697303#M714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T13:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697322#M715</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;I dropped the DIM_RATES table and re-imported, set the relationships again and its working perfectly now. Thanks a bunch!&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 14:01:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697322#M715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T14:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697324#M716</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; weird, anyhow there was nothing much I could do , sometime it is hard to figure out without looking at real model, glad it worked out.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 14:04:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/697324#M716</guid>
      <dc:creator>parry2k</dc:creator>
      <dc:date>2019-05-22T14:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Translate foreign currency transactions based on selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/2064598#M46643</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="507" data-lia-user-login="parry2k" class="lia-mention lia-mention-user"&gt;parry2k&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;what was the final DAX pattern to get the right rate for each selected month ?&lt;BR /&gt;I have a similar issue&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Translated-value-calculation-with-currency-rate-on-separate/m-p/2064585#M770468" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Translated-value-calculation-with-currency-rate-on-separate/m-p/2064585#M770468&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 15:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Translate-foreign-currency-transactions-based-on-selected-date/m-p/2064598#M46643</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-08T15:09:15Z</dc:date>
    </item>
  </channel>
</rss>

