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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Currency Conversion using historical Conversion Table

Good evening Community!

 

I have a problem that I am finding difficult to solve.  I have read and read and read, but I can't not find a solution that works.  I am trying to do Currency Conversion for all sales of the last X years, (X can change), but there are two major considerations.  1) All data is historical, therefore has to convert into the chosen Currency based on the rate at the time of Transaction. and 2) Due to the complicated nature of the rest of my model, none of my relationships to my main dimDate table can be active.  They all have to be inactive. (i have been using USERELATIONSHIP in almost every measure dependant on date with great success)

 

I have a Sales table with all values already converted to USD. (Sample Below)

Sales_in_USDTransaction Date
1001/1/2020
42.43/5/2020
43501/5/2021

 

I also have an Exchange Rate table with the Currency, ExchangeDate and Rate. (Sample Below)

CurrencyCodeExchangeDateExchangeRate
EUR1/1/20200.89
EUR3/5/20200.88
EUR1/5/20210.9
AUD1/1/20201.2
AUD3/5/20201.2
AUD1/5/20211.1
CAD1/1/20201.11
CAD3/5/20201.13
CAD1/5/20211.2
GBP1/1/20200.9
GBP3/5/20200.97
GBP1/5/20210.91

 

What im looking to do is using a filter or slicer, allow the user to select one Currency and have all the totals convert to that currency for the time frame selected.  This will more than likely be a total number in a card, not really shown as a table. However, as mentioned before, that Sum needs to take into consideration the dates at which the transaction took place in order to convert correctly.   The ideal result would be like this....

 

If the User chose (Currency) it would show (Total)

EUR4041.312
AUD4955.88
CAD5378.912
GBP4089.628

 

Any help is greatly appreciated.  Please let me know if I need to explain any parts further (i tend to struggle on that part)

 

Thanks!

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous have relationship between these two tables on Transaction Date , it will be many to many, on relationship page set relation that "Sales filter Currency table"

 

and now add the following measure

 

SUMX ( SalesTable, CALCULATE ( SUM ( SalesTable[Amount] ) ) * CALCULATE ( MAX ( ExchangeTable[ExchangeRate] ) 

 

add slicer on Currency code and have it single select so that a currency is selected.

 

Use this new measure to get sales in the selected currency.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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

3 REPLIES 3
Anonymous
Not applicable

Hi @parry2k ,

 

This is great. It solved 60% of my promblem. 
Just wanted to ask what is the solution is i have 30 - 35 columns. The scalability is the issue for me if the number of columns increases. 

Could you suggest any solution. 

parry2k
Super User
Super User

@Anonymous have relationship between these two tables on Transaction Date , it will be many to many, on relationship page set relation that "Sales filter Currency table"

 

and now add the following measure

 

SUMX ( SalesTable, CALCULATE ( SUM ( SalesTable[Amount] ) ) * CALCULATE ( MAX ( ExchangeTable[ExchangeRate] ) 

 

add slicer on Currency code and have it single select so that a currency is selected.

 

Use this new measure to get sales in the selected currency.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

Anonymous
Not applicable

That did the trick!  I think i was too wrapped up in the dimDate table.

 

Thank you so much!

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.