cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LisaB
Helper II
Helper II

Calculate amounts in local currency

Hi,

 

I have different amounts in currency but wish to calculate them to local currency.

 

I have three different tables, see examples below. The first table contains the currency code but no amounts. The second table (invoicing lines) does not contain currency codes but line amounts. The third table is the exchange rate table that contains one exchange rate per day. 

 

In the second table, the invoicing lines, I only want to retreive some amounts, I have marked them in bold.

 

I wish to retreive the amounts in local currency for only some invoicing lines (this will be a page level filter) using the latest exchange rate available.

 

Any advice?

 

Contract table
Contract NoCurrency Code
CON001USD
CON002EUR
CON003SEK
CON004GBP

 

Contract invoicing lines
Contract NoItem NoLine Amount
CON00110010 000
CON0011012 000
CON0021005 000
CON0032003 000
CON0032401 000
CON00430020 000

 

Currency exchange rates
2019-05-11USD10
2019-05-11EUR10
2019-05-11SEK1
2019-05-11GBP11
2019-05-12USD10,1
2019-05-12EUR9,9
2019-05-12SEK1
2019-05-12GBP11,2

 

Thanks!

 

Lisa B

1 ACCEPTED SOLUTION

@LisaB solution attached.

 

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@LisaB your post in not very clear:

 

what is local currency?

You mentioned for few line items you want to convert? What is the logic of few lines?

 

Can you put example of what you expected result to be?

 

Also I believe contact number in contract table (1st table) is unique?






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Hi @parry2k,

 

The local currency is SEK (exchange rate = 1)

The first table is the contract header where contract no is the unique key. The second table is the invoicing lines for the contracts. The purpose is to calculate the ARR and only a few items numbers are recurring revenue. However, as long as I can get the amount i SEK for each line I can put a page level filter on item number.

 

Expected result:

 

Contract NoItem NoLine AmountCurrency code (not in table)Line Amount (LCY) (not in table)
CON00110010 000USD101 000
CON0011012 000USD20 200
CON0021005 000EUR49 500
CON0032003 000SEK3 000
CON0032401 000SEK1 000
CON00430020 000GBP224 000

 

Hope this clarifies.

 

Thanks.

@LisaB solution attached.

 

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Hi @parry2k ,

 

The solution you sent worked perfectly fine until now (?). This is how the formula now looks like. I haven't made any changes to the data or the formula.

 

Can you see why I get this error?

 

exchange.PNG

 

Many thanks

 

Lisa

@LisaB any table name or column name changed?






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Hi,

 

Nope, no changes. What's wierd is that I can refresh the report without any problems, it is when I look into the formula I get the error and after that it is no longer possible to refresh the report. Hope that makes sense...

 

L

Hi again @parry2k,

 

It seems like the formula doesn't pick up ResultIfFalse in the IF-statement, see picture:

 

exchange new.PNG

Hm - I hit tab ("1 ;") instead of  ";" directly after the number 1 and it now works again...

Hi @parry2k ,

 

Many thanks - works like a charm.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!