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
Anonymous
Not applicable

Converting Revenue according to a set quarterly exchange rate for multiple currencies

Hi,

 

Hope im posting this to the right channel!

I have two excel based dataset

 

Dataset 1: Quarterly USD exchange rate table

  • A list of set currencies that are used to calculate sales in various currencies during a quarter, to USD
QuarterLocal CCYUSD xrate
4-2020SEK9.700
4-2020NOK9.120
4-2020DKK6.100
4-2020EUR0.799
4-2020USD1.000
3-2020SEK9.200
3-2020NOK9.620
3-2020DKK6.100
3-2020EUR0.911
3-2020USD1.000

 

Dataset 2: Sales data in a table

  • The data itself is much more complex and has customer details etc, but the rows always have these values
QuarterLocal CCYTotal sales (local CCY)
4-2020SEK5,114,999
4-2020NOK4,105,999
4-2020DKK2,116,999
4-2020EUR111,999
4-2020USD113,999
3-2020SEK4,113,999
3-2020NOK2,13,999
3-2020DKK1,113,999
3-2020EUR113,999
3-2020USD113,999

 

 

End result I would want to produce in Table visualisation in POWER BI:

  • "Total sales (USD)" column would be filled with the conversion result using the matching quarter to a matching Local Currency --> "Total sales (Local CCY)" divided by "USD xrate"
QuarterLocal CCYTotal sales (local CCY)Total sales (USD)
4-2020SEK5,114,999 
4-2020NOK4,105,999 
4-2020DKK2,116,999 
4-2020EUR111,999 
4-2020USD113,999 
3-2020SEK4,113,999 
3-2020NOK2,13,999 
3-2020DKK1,113,999 
3-2020EUR110,999 
3-2020USD116,999 

 

Thank you very much for your help in advance.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous - Well, you could either create a calculated column or measure like this:

Calculated Column = DIVIDE('Dataset 2'[Total sales (local CCY)],LOOKUPVALUE('Dataset 1'[USD xrate],'Dataset 1'[Quarter],'Dataset 2'[Quarter],'Dataset 1'[Local CCY],'Dataset 2'[Local CCY]),0)

Or you could create a concatenated column in both tables, [Quarter] & "-" & [Local CCY] and form a relationship between them and then you could just use RELATED or RELATEDTABLE in your calculation instead of LOOKUPVALUE. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

If the above posts help, please kindly mark it as a answer to help others find it more quickly. thanks!

If not, please kindly elaborate more.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Greg_Deckler
Super User
Super User

@Anonymous - Well, you could either create a calculated column or measure like this:

Calculated Column = DIVIDE('Dataset 2'[Total sales (local CCY)],LOOKUPVALUE('Dataset 1'[USD xrate],'Dataset 1'[Quarter],'Dataset 2'[Quarter],'Dataset 1'[Local CCY],'Dataset 2'[Local CCY]),0)

Or you could create a concatenated column in both tables, [Quarter] & "-" & [Local CCY] and form a relationship between them and then you could just use RELATED or RELATEDTABLE in your calculation instead of LOOKUPVALUE. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.