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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
artfulmunkeey
Helper I
Helper I

Help with currency conversion

Hi all, I am rather stuck on the following problem and wonder if anyone can advise?

 

I have a table loaded with values in a single column which are a mixture of currencies.

 

PeriodLineValueCurrency
201912PAY ICO---5,437,330.00EUR
202000PAY A ICO---5,400,297.41EUR
201812PAY ICO---4,763,415.20EUR
201900PAY A ICO---4,595,511.31EUR
201900PAY ICO---4,562,300.84CAD
201800LIA OTH---4,506,109.05EUR
201812INC OTH-INT--4,414,344.44EUR
201800PAY A ICO---4,225,874.50EUR
201912WIP-EXT--4,060,620.32GBP
202007REC A ICO---4,041,224.00EUR
201912INC OTH-INT--4,024,194.23EUR

 

I also have a table of conversion rates

 

PeriodEURCADGBPCZKUS
20200011.4556040760.84620267725.424237571.122700752
20200111.4650751810.83989896425.219250421.108084542
20200211.4788781530.86016186725.453472211.102707385
20200311.5562671830.88508639727.351711731.102358727
20200411.52065820.86736575127.080867031.093243896
20200511.5290535480.89955790526.925825371.110623282
20200611.5298412690.90832724826.64340151.123464042
20200711.5819337780.90028743926.25276091.18192734
20200811.5576618010.89344934326.267826291.195324388
20200911.5576618010.89344934326.267826291.195324388
20201011.5576618010.89344934326.267826291.195324388
20201111.5576618010.89344934326.267826291.195324388
20201211.5576618010.89344934326.267826291.195324388

 

I've also unpivoted the table to create this (not sure which is best option)

 

PeriodCurrencyRate
202000EUR1
202000CAD1.455604
202000GBP0.846203
202000CZK25.42424
202000USD1.122701
202001EUR1
202001CAD1.465075
202001GBP0.839899
202001CZK25.21925
202001USD1.108085
202002EUR1
202002CAD1.478878
202002GBP0.860162
202002CZK25.45347
202002USD1.102707
202003EUR1
202003CAD1.556267
202003GBP0.885086
202003CZK27.35171
202003USD1.102359
202004EUR1
202004CAD1.520658
202004GBP0.867366
202004CZK27.08087
202004USD1.093244
202005EUR1
202005CAD1.529054
202005GBP0.899558
202005CZK26.92583
202005USD1.110623
202006EUR1
202006CAD1.529841

I have created a quick measure to calculate the average rates.

 

I would like to create an additional column in the first table which lists the value of each line in EUR as per below:

 

PeriodLineValueCurrencyCalculatedValue in €
201912PAY ICO---5,437,330.00EUR-5,437,330.00
202000PAY A ICO---5,400,297.41EUR-5,400,297.41
201812PAY ICO---4,763,415.20EUR-4,763,415.20
201900PAY A ICO---4,595,511.31EUR-4,595,511.31
201900PAY ICO---4,562,300.84CAD-251,326.98
201800LIA OTH---4,506,109.05EUR-4,506,109.05
201812INC OTH-INT--4,414,344.44EUR-4,414,344.44
201800PAY A ICO---4,225,874.50EUR-4,225,874.50
201912WIP-EXT--4,060,620.32GBP-4,449,345.55
202007REC A ICO---4,041,224.00EUR-4,041,224.00
201912INC OTH-INT--4,024,194.23EUR-4,024,194.23

 

I know I need to lookup the currecny column and apply the conversion, however, I am struggling to write the expression.

 

Can anyone please help with this?

 

Many thanks in advance!

 

Alex

 

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@artfulmunkeey  Hi You can achieve the result without doing unpivoting the columns. What I understand that have two tables like below

 

negi007_0-1601122086747.png

negi007_1-1601122106085.png

 

You can create a calculated column in your table 2 like 

Value in Euro = LOOKUPVALUE(Conversion[EUR],Conversion[Period],'Currency'[Period])*'Currency'[Value]
Final output is below
 
negi007_0-1601122239285.png

Let me know if you are expecting some other output.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

2 REPLIES 2
negi007
Community Champion
Community Champion

@artfulmunkeey  Hi You can achieve the result without doing unpivoting the columns. What I understand that have two tables like below

 

negi007_0-1601122086747.png

negi007_1-1601122106085.png

 

You can create a calculated column in your table 2 like 

Value in Euro = LOOKUPVALUE(Conversion[EUR],Conversion[Period],'Currency'[Period])*'Currency'[Value]
Final output is below
 
negi007_0-1601122239285.png

Let me know if you are expecting some other output.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Perfect! Thanks so much, that's exactly what I needed

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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