Forum Discussion

davidanstee's avatar
davidanstee
Frequent Visitor
7 years ago
Solved

Help with currency conversion using LOOKUPVALUE with Exchange Rate month by month

Hey Everyone, 

 

I hope that anyone can help me with a problem I have when trying to lookup an exchange rate for a transaction on a given month. 

 

I am using an Exchange Rate table as follows:

 

And I am using a Calculated Coloumn like this:

 

REVENUE_FORECAST_CURRENCYRATETO_USD = 
LOOKUPVALUE (
    'IFS_Currency_Convert'[CONVERSION RATE],
    'IFS_Currency_Convert'[FROM CURRENCY], Revenue_Forecast[Currency],
    'IFS_Currency_Convert'[TO CURRENCY], "USD",
    'IFS_Currency_Convert'[RATE DATE].[Year], Revenue_Forecast[PROJ_CREATED_DATE].[Year],
    'IFS_Currency_Convert'[RATE DATE].[MonthNo], Revenue_Forecast[PROJ_CREATED_DATE].[MonthNo]
)

 

But the results I am getting look like this:

 

 

 

As you can see the table to the left, are the transactions with the attempt to pull the currency rate, and the table to the right is a view of the currency table. You will see on many of the results in the transactions, it is doing some kind of sum for the exhange rate? Why is this? What am I doing wrong?

 

Additionally, and annoyingly, the Exchange Rate table that is used by my company does not include the rates used for same currency (e.g. USD to USD = 1 and GBP to GBP = 1). How can I easily add these exchange rates into the table on a Month by Month basis?

  • davidanstee Could you please check and confirm whether you have multiple entries for same productid in the same month and year, in that case it might sum up the values. Then you need to select "Don't Summarize" option. The lookup formula looks fine. Regarding your last point, USD to USD and GBP to GBP - Anyway you are hardcoding the TO_CURRENCY value to USD (So everything you want to show in USD isn't it) so what's the purpose of having those same from and to currency values in your lookup table. 

5 Replies

  • Hi there, I would recommend doing the currency conversion in the Query Editor or source.

    Whilst the lookup does work if your dataset is large or becomes large it will become quite slow
  • PattemManohar's avatar
    PattemManohar
    Community Champion

    davidanstee Could you please check and confirm whether you have multiple entries for same productid in the same month and year, in that case it might sum up the values. Then you need to select "Don't Summarize" option. The lookup formula looks fine. Regarding your last point, USD to USD and GBP to GBP - Anyway you are hardcoding the TO_CURRENCY value to USD (So everything you want to show in USD isn't it) so what's the purpose of having those same from and to currency values in your lookup table. 

    • davidanstee's avatar
      davidanstee
      Frequent Visitor

      OMG, I cannot beleive I missed something so obvious!

       

      Couldnt see the wood for the trees!

       

      Thanks for pointing out my silly mistake :)

    • davidanstee's avatar
      davidanstee
      Frequent Visitor

      PattemManohar In regards to the second point...

       

      Currently the REVENUE amount field, is in mixed currencies dependant on where business was transacted (its an older platform that is not multi-currency aware). What I eventually want to get to, is to be able to choose the "OUTPUT" currency based on a Selection. And therefore in my exchange table I will need everything inclusive. Today the table from the system doesnt have GBP to GBP or USD to USD or EUR to EUR

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi davidanstee,

     

    As PattemManohar mentioned, please check whether the field [REVENUE_FORECAST_CURRENCYRATETO_USD] added to table visual is summarized by default. If yes, please change it to "Don't summarize".

     

    Regards,

    Yuliana Gu