Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Currency conversion based on type and date

Another day, another PBI case 🙂 I'm completely turned around with this one. What I'd like to do is determine a transaction value for a given conversion rate based on a given timeframe. I have two ta...
  • johnt75's avatar
    4 years ago

    You can add the below as a calculated column

    USD Value =
    VAR convRate =
        MAXX (
            TOPN (
                1,
                FILTER (
                    'Currency Conversion',
                    'Currency Conversion'[Currency Type] = 'Transactions Table'[Currency]
                        && 'Currency Conversion'[Date time] <= 'Transactions Table'[Date time]
                ),
                'Currency Conversion'[Date time]
            ),
            'Currency Conversion'[Conversion]
        )
    RETURN
        'Transactions Table'[Value] * convRate