Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Exchange Rate Conversion with Date Range

Hey Everyone, 

I need to convert the value of revenue (total_revenue_usd in finance table) into other currencies (exchange_rate table). If the transaction took place '6/1/2022', it must be converted at the exchange rate of that day. The user can choose the type of currency (name in exchange_rate table), using the dropdown and in addition with the slicer the date range (baseline_date) when the sale took place - it can be just one day or several days.

wcaleniewiola_0-1658411285046.png

 

Currently I've managed to do it in such a way that it works for a single day, but if I select a range of several days, it recalculates the value of the revenue based on the exchange rate of the last day selected in slicer. What I want is to recalculate each day separately at a given rate and then sum up the revenue value.

My data model without sensitive data:

wcaleniewiola_0-1658412315852.png

I have the following metrics in my measure table:

 

Converted_Revenue = 
VAR _Date = [Currency_Date]
VAR _CurrencySelected = [Currency_Selected]
VAR _Revenue = Measure_Table[Revenue]
VAR _Rate = LOOKUPVALUE(exchange_rates_query[usd_exchange_rate], 
                        exchange_rates_query[name], _CurrencySelected, 
                        exchange_rates_query[day], _Date)
VAR _ConvertedMeasure = _Revenue / _Rate

RETURN
_ConvertedMeasure

 

where currency_date is max(dim_date(day)) and currency_selected = SELECTEDVALUE(Dim_Currency_Names[currency]).

Any help would be appreciated. Thanks!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Converted Revenue =
SUMX (
    'Finance query',
    VAR currentDate = 'Finance query'[day]
    VAR chosenCurrency = [Currency Selected]
    VAR exchRate =
        LOOKUPVALUE (
            exchange_rates_query[usd_exchange_rate],
            exchange_rates_query[name], chosenCurrency,
            exchange_rates_query[day], currentDate
        )
    RETURN
        'Finance query'[total_revenue_usd] * exchRate
)

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

It worked! Many thanks!

johnt75
Super User
Super User

Try

Converted Revenue =
SUMX (
    'Finance query',
    VAR currentDate = 'Finance query'[day]
    VAR chosenCurrency = [Currency Selected]
    VAR exchRate =
        LOOKUPVALUE (
            exchange_rates_query[usd_exchange_rate],
            exchange_rates_query[name], chosenCurrency,
            exchange_rates_query[day], currentDate
        )
    RETURN
        'Finance query'[total_revenue_usd] * exchRate
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.