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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
carlenb
Advocate II
Advocate II

Exchange rates over time - model attached

Hi all,

 

See model with data here: https://drive.google.com/file/d/1C19jmtujw53LD2YPwvLDq1uF_QLxRIu5/view?usp=sharing

 

I have the following data

  • Sales table with [sales], [currency], [order date] from 2019-2022 
  • Exchange rate table with [from currency], [to currency] [exchange rate] and [valid from] 2019-2022 

Problem

  • I want to sum the sales from 2019-2022 and convert to local currency (SEK)
  • For example if the exchange rate from EUR to SEK is 8,6 then a sales order of 10 euro would convert to 86 SEK
  • Sales order date must pick the "Valid from" exchange rate closest to this date
  • Example: Based on the data tables below, the USD sales order 2019-05-02 should pick the exchange rate from 2019-06-07, the exchange rate is 9,5 and sale in local currency 15 656 

carlenb_0-1698998244204.png

Sales volumeSales dateCurrency
18802019-04-01SEK
16482019-05-02USD
9062019-06-03EUR
10712019-07-04EUR
15772019-07-04EUR
7492020-04-01EUR
10852020-04-02EUR
10612020-08-03USD
18852020-04-04SEK
6492020-04-05CHF
2872021-04-01CHF
12112021-04-15SEK
13652021-04-03EUR
7552021-04-04SEK
19082021-04-05USD
12762021-04-06USD
16542022-04-14SEK
19932022-04-08CHF
16972022-04-09CHF
19282022-10-10SEK
5062022-04-11EUR
9852022-04-12SEK
19512022-04-13SEK
13272022-04-14SEK

 

From currencyTo currencyValid fromExchange rate
CHFSEK2019-05-0612,1
USDSEK2019-06-079,5
EURSEK2019-07-058,6
CHFSEK2019-08-0612,11
USDSEK2019-09-079,57
EURSEK2019-10-058,3
CHFSEK2020-05-0612,1
USDSEK2020-06-079,5
EURSEK2020-07-058,6
CHFSEK2020-08-0612,11
USDSEK2020-09-079,57
EURSEK2020-10-058,3
CHFSEK2021-05-0612,1
USDSEK2021-06-079,5
EURSEK2021-07-058,6
CHFSEK2021-08-0612,11
USDSEK2021-09-079,57
EURSEK2021-10-058,3
CHFSEK2022-05-0612,1
USDSEK2022-06-079,5
EURSEK2022-07-058,6
CHFSEK2022-08-0612,11
USDSEK2022-09-079,57
EURSEK2022-10-058,3

 

Output

  • A measure where the 2019-2022 sales are converted to SEK based on the sales table
  • From this I can create a graph with Sales (y axis) and Year (x-axis)
1 ACCEPTED SOLUTION
carlenb
Advocate II
Advocate II

I solved this myself by importing a historial exchange rate table from investing.com (with ALL dates ranging from 2019 to 2022) and then following this guide: 

 

https://www.youtube.com/watch?v=9oPFgHvGyKc&t=14s

View solution in original post

1 REPLY 1
carlenb
Advocate II
Advocate II

I solved this myself by importing a historial exchange rate table from investing.com (with ALL dates ranging from 2019 to 2022) and then following this guide: 

 

https://www.youtube.com/watch?v=9oPFgHvGyKc&t=14s

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.