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
Telstar
Helper I
Helper I

Get Exchange rates from two different periods and regions and calculate the current value

Hi All

Am stuck on how to explain this let alone achieve in Power BI !! Here goes:

I have an amountU$ for a period and region.
I have exchange rates for that period and region

I also have exchange rate for 'current period' and region

 

What I need to do is take the amountU$ divide, it by the ex rate for that period and region, then multiply that result by the ex rate for the 'current period' and region

 

so in one table i have

Region; Period; AmountUS;

EUR ; Period1; 10000

ASA;Period1;100

AUS;Period1;50

 

Ex table

Region;Period;ExRate

EUR;Period1;1.1

EUR;Period4;1.2

ASA;Period1;1.5

ASA;Period4;1.75

AUS;Period1;0.8

AUS;Period4;0.9

(where period4 is the current period)

 

Want I want to end up with is the following

Region;OrigAmtU$;NewAmtU$

EUR;10000;10909       >>> 10000/1.1*1.2

ASA;100;117               >>> 100/1.5*1.75

AUS;50;56                   >>> 50/0.8*0.9

 

I can do the simple AmountU$ / ex rate Period 1

BUT I cannot seem to be able to create a measure for the Period4 that I can use multiply 

 

Any help / suggestions much appreciated.

Thanks

Telstar

2 ACCEPTED SOLUTIONS
v-eachen-msft
Community Support
Community Support

Hi @Telstar ,

 

According to your sample data, you could use LOOKUPVALUE() function to find the data.

Column =
VAR a =
    LOOKUPVALUE (
        'Ex Table'[ExRate],
        'Ex Table'[Region], 'Table'[Region],
        'Ex Table'[Period], 'Table'[Period]
    )
VAR b =
    LOOKUPVALUE (
        'Ex Table'[ExRate],
        'Ex Table'[Region], 'Table'[Region],
        'Ex Table'[Period], 4
    )
RETURN
    ROUND ( 'Table'[AmountUS] / a * b, 0 )

If you have created relationships between there tables, you could also use RELATED() function.

Or you could create a new table to save Period4's data.

Here is my test result and test file for your reference,

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Hi @v-eachen-msft 

Thanks - works perfect

 

@Telstar 

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Telstar ,

 

According to your sample data, you could use LOOKUPVALUE() function to find the data.

Column =
VAR a =
    LOOKUPVALUE (
        'Ex Table'[ExRate],
        'Ex Table'[Region], 'Table'[Region],
        'Ex Table'[Period], 'Table'[Period]
    )
VAR b =
    LOOKUPVALUE (
        'Ex Table'[ExRate],
        'Ex Table'[Region], 'Table'[Region],
        'Ex Table'[Period], 4
    )
RETURN
    ROUND ( 'Table'[AmountUS] / a * b, 0 )

If you have created relationships between there tables, you could also use RELATED() function.

Or you could create a new table to save Period4's data.

Here is my test result and test file for your reference,

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-eachen-msft 

Thanks - works perfect

 

@Telstar 

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.