Forum Discussion

3 Replies

  • selimovd's avatar
    selimovd
    Most 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] * vExchangeRate

     

    If 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 regards
    Denis
     
    • FaizanRao's avatar
      FaizanRao
      New Member

      Hi Denis

       

      Thanks for your prompt reply but still need your help to fix the following error.