Forum Discussion
FaizanRao
5 years agoNew Member
Exchange rate conversion with date range
Hi
I need help to calculate sales in USD and Peso based on the exchange rate in Table 2.
Thanks
Faizan Rao
3 Replies
- Jihwan_KimSuper User
- selimovdMost Valuable Professional
Hey FaizanRao ,
as calculated column something like this should do it:
Sales in USD = VAR vInvoiceDateCurrentRow = 'Table 1'[Invoice Date] VAR vCurrencyCurrentRow = 'Table 1'[Sales Currency] VAR vExchangeRate = CALCULATE( MAX( 'Table 2'[Exchange Rate] ), 'Table 2'[Currency From] = vCurrencyCurrentRow && 'Table 2'[Currency To] = "USD" && 'Table 2'[Date From] <= vInvoiceDateCurrentRow && 'Table 2'[Date To] >= vInvoiceDateCurrentRow ) RETURN 'Table 1'[Sales Value] * vExchangeRateIf you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic- FaizanRaoNew Member
Hi Denis
Thanks for your prompt reply but still need your help to fix the following error.