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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
dxg169
Regular Visitor

Help with converting source cashflows in consistent currency

Hi All - I'm sturggling to work out how to convert source cashflows in local currency into USD so I can then aggregate. I was initially trying to create a measure using look up to bring in fx rate needed, before creating another measure to multiply these. Note that the source file (table1) does not have the local currency code in it hence why I have a mapping table (table 2).

 

I have:

a source table of cashflows in local fund currency (either USD or EUR);

a fund mapping table which shows what the fund local currency is. This also has a parent fund mapping that I'll use to aggregate certain funds once the cashflows are converted;

a FX table of conversion rates for USD and EUR at each date. I have unpivoted this (i.e. the source file has a single row per date and a column of USD and column for EUR.

Table 1: Cashflows

DateFundCashflow
1/1/2001Fund A-EUR100
1/1/2001Fund A-USD110
1/2/2001Fund B-EUR120
etc  

 

Table 2: Fund mapping

FundParent FundFund Currency
Fund A-EURFund AEUR
Fund A-USDFund AUSD
Fund B-EURFund BEUR
etc  

 

Table 3: FX rates (this has been unpivoted)

DateCurrency to USDFx Rate
1/1/2001USD1
1/1/2001EUR1.21
2/1/2001USD1
2/1/2001EUR1.23
etc  
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a calculated column on the cashflows table like

Cashflow USD =
VAR CurrentCurrency =
    RELATED ( 'Fund mapping'[Currency] )
VAR CurrentDate = 'Cashflows'[Date]
VAR Rate =
    LOOKUPVALUE (
        'FX rates'[FX rate],
        'FX Rates'[Date], CurrentDate,
        'Fx Rates'[Currency], CurrentCurrency
    )
RETURN
    'Cashflows'[Cashflow] * Rate

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

Create a calculated column on the cashflows table like

Cashflow USD =
VAR CurrentCurrency =
    RELATED ( 'Fund mapping'[Currency] )
VAR CurrentDate = 'Cashflows'[Date]
VAR Rate =
    LOOKUPVALUE (
        'FX rates'[FX rate],
        'FX Rates'[Date], CurrentDate,
        'Fx Rates'[Currency], CurrentCurrency
    )
RETURN
    'Cashflows'[Cashflow] * Rate

Thank you, this has worked. 

For my own understanding, is there any way to do this as a measure? Or is that not fit for this purpose.

I don't think that would suit in this situation. There are several advantages of doing it as a column. The calculation only happens once, during data refresh, and so the end user will not see any performance problems, and with a column you can then create other measures on top of that. Having to calculate it on the fly for every visual would not give good performance.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.