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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Aleli
Frequent Visitor

Dynamic currency conversion

Hi,

 

Can anyone suggest a simpler way to show converted amount to USD?

 

Currently, here's what I have:

Table 1 - COUNTRY, YEAR, MONTH, INCOME (in local currency)

Table 2 - YEAR, MONTH, LOCAL CURRENCY, EXCHANGE RATE (to convert local currency to USD)

Year Slicer from 2013 to 2017 -- Whatever is selected will be treated as "CURRENT YEAR" (CY), and will be compared against the "PRIOR YEAR" (PY = CY-1) income.

 

My goals:

Present CY and PY figures in a bar chart. X-axis=COUNTRY, Y-axis=INCOME

Add a new slicer that will give the user an option whether to use current year or prior year exchange rate

 

I believe only the CY figure should change, depending on the exchange rate year slicer.

 

Many thanks!

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Aleli

 

In this scenario, if these two tables are related to a full calendar date table. You can use SAMEPERIODLASTYEAR() function to get the last year exchange rate. You can create a measure in Table 2.

 

exchange rate last year = CALCULATE(AVERAGE(Table2[EXCHANGE RATE]),SAMEPERIODLASTYEAR(Date[Date]))

 

If you only have YEAR and MONTH column in both tables, you can create a calculated column to get the previous YEAR EXCHANGE RATE.

 

previous year exchange rate = 
CALCULATE(
AVERAGE(Table2[EXCHANGE RATE]),
FILTER(Table2, Table2[YEAR]=EARLIER(Table2[YEAR])-1 && Table2[MONTH] = EARLIER(Table2[MONTH]))
)

Regards,

 

Hi @v-sihou-msft,

 

I copied your second formula but got an error saying "EARLIER refers to an ealier row context which doesn't exist".

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors