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
TheBaz_57
Frequent Visitor

Find fx rate and convert amount to local currency from different table.

Hi all,

 

I seek your help once again.

 

I have two tables as follows:

#1

NameAmount in USDLocal CurencyDateRelationship column
Tom5000GBP25/03/2024GBP-25/03/2024
Peter57GBP10/02/2024GBP-10/02/2024
Sam457GBP16/01/2024GBP-16/01/2024
Tom 16GBP02/02/2024GBP-28/02/2024
Peter 150GBP03/02/2024GBP-03/02/2024
Sam877GBP02/04/2024GBP-02/04/2024

 

#2

DateCurrencyXchrateRelationship column
01/02/2024AUD0.58AUD-01/02/2024
01/02/2024GBP1.02GBP-01/02/2024
02/02/2024AUD0.69AUD-02/02/2024
02/02/2024GBP1.05GBP-02/02/2024
03/02/2024AUD0.63AUD-03/02/2024
03/02/2024GBP1.002GBP-03/02/2024
04/02/2024AUD AUD-04/02/2024
04/02/2024GBP GBP-04/02/2024
05/02/2024AUD AUD-05/02/2024
05/02/2024GBP GBP-05/02/2024

 

A relationship has been created based on the relationship columns. 

 

then in PBI I have a matrix like this

 

NameMinimum AmountMinimum amount dateRateMinimum amount in Local ccy
Tom1628/02/2024  
Peter5710/02/2024  
Sam45716/01/2024  

 

What I need to find is the rate when the minimum amount occured and then get the amount in local ccy. 

 

For the rate I have tried the following but doesn't work:

Rate =
VAR _minQty = MIN('#1'[Amount in USD])
VAR _minDate = CALCULATE(
    MIN('#1'[Date]),'#1'[Amount in USD] = _minQty)
VAR _rate = CALCULATE(
    MIN('#2'[Xchrate]= _minDate)
RETURN _rate)
 
Thanks fo the help
3 REPLIES 3
v-yohua-msft
Community Support
Community Support

Hi, @TheBaz_57 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

Best Regards

Yongkang Hua

Greg_Deckler
Super User
Super User

@TheBaz_57 If the two tables are related you should just have to do an aggregation on each column and multiply them together. Maybe I'm not understanding something but hard to test as the sample data doesn't include the related rows for the currency conversion.


@ 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...
TheBaz_57
Frequent Visitor

 why my tables look so crappy 🙄

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.