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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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