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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Aleli
Frequent Visitor

dynamic computation based on slicer

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!

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

There are a few approaches, depending on your data.

 

If you have monthly data for all months and every month as exchange rate data too, you can do this.

 

create a calendar table that contains the months (with a unique ID)

Join the 2 data tables (Table 1, Table 2) to this one common calendar table.

 

When you filter from the calendar table by month, both table 1 and table 2 will be filtered.  You can then "harvest" the exchange rate with something like this

 

Rate To Use = Max(Table2[Exchange Rate])

 

As long as you only have every month covered once and always once, this formula will give you the exchange rate.

 

To work out the conversion, you could use something like this

Income Local Currency = sum(table1[Income])

Converted Rate = sumx(Calendar,[Income Local Currency] * [Rate To Use])

 

For the time intelligence needs, take a read of the article I posted this week here http://exceleratorbi.com.au/dax-time-intelligence-beginners/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

1 REPLY 1
MattAllington
Community Champion
Community Champion

There are a few approaches, depending on your data.

 

If you have monthly data for all months and every month as exchange rate data too, you can do this.

 

create a calendar table that contains the months (with a unique ID)

Join the 2 data tables (Table 1, Table 2) to this one common calendar table.

 

When you filter from the calendar table by month, both table 1 and table 2 will be filtered.  You can then "harvest" the exchange rate with something like this

 

Rate To Use = Max(Table2[Exchange Rate])

 

As long as you only have every month covered once and always once, this formula will give you the exchange rate.

 

To work out the conversion, you could use something like this

Income Local Currency = sum(table1[Income])

Converted Rate = sumx(Calendar,[Income Local Currency] * [Rate To Use])

 

For the time intelligence needs, take a read of the article I posted this week here http://exceleratorbi.com.au/dax-time-intelligence-beginners/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.