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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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