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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PBI-BOLA
Frequent Visitor

Use currency table to calculate rate to third currency

I have a table like the below

 

Currency_CodeStarting_DateMonthly Average Conversion Rate to GBP
AED01/11/2023 00:004.553310714
AED01/10/2023 00:004.469232258
AED01/09/2023 00:004.552056667
GBP01/11/2023 00:001
GBP01/10/2023 00:001
GBP01/09/2023 00:001
AUD01/11/2023 00:001.911332143
AUD01/10/2023 00:001.916648387
AUD01/09/2023 00:001.928933333
EUR01/11/2023 00:001.147792857
EUR01/10/2023 00:001.151916129
EUR01/09/2023 00:001.160366667
SGD01/11/2023 00:001.673132143
SGD01/10/2023 00:001.665458065
SGD01/09/2023 00:001.688866667
USD01/11/2023 00:001.239860714
USD01/10/2023 00:001.216941935
USD01/09/2023 00:001.23949

 

I'm trying without luck to create a calculated column that would take the monthly to gbp rate and divide it by the monthly rate for USD within the relevant month, trying to do this without the "Calculate" funtion as I know that can cause performance issues. This would allow me to get the direct conversion for each into USD.

My table has been simplified for this question. The actual table would contain rates for each day throughout a month. 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@PBI-BOLA,

 

Try this calculated column:

 

GBP/USD Rate = 
VAR vStartingDate = 'Currency'[Starting_Date]
VAR vUSDRate =
    MAXX (
        FILTER (
            'Currency',
            'Currency'[Currency_Code] = "USD"
                && 'Currency'[Starting_Date] = vStartingDate
        ),
        'Currency'[Monthly Average Conversion Rate to GBP]
    )
VAR vResult =
    DIVIDE ( 'Currency'[Monthly Average Conversion Rate to GBP], vUSDRate )
RETURN
    vResult

 

DataInsights_0-1701441659585.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
DataInsights
Super User
Super User

@PBI-BOLA,

 

Try this calculated column:

 

GBP/USD Rate = 
VAR vStartingDate = 'Currency'[Starting_Date]
VAR vUSDRate =
    MAXX (
        FILTER (
            'Currency',
            'Currency'[Currency_Code] = "USD"
                && 'Currency'[Starting_Date] = vStartingDate
        ),
        'Currency'[Monthly Average Conversion Rate to GBP]
    )
VAR vResult =
    DIVIDE ( 'Currency'[Monthly Average Conversion Rate to GBP], vUSDRate )
RETURN
    vResult

 

DataInsights_0-1701441659585.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you very much!

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.