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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Nikki
Helper II
Helper II

currency conversion help please

hi everyone

 

so i have a sql direct query with several tables;

 

table1 = financials

table2 = conversionrates

 

 

table1 has about 20 columns in sqlazure that has a bunch of numeric AUD data

 

table2 has 10 different conversion rates which are AUD to for example USD and AUD to Euro and so on

 

(my customer sets the conversion rates)

 

so how can i create a measure or slicer that will allow me to pick say USD or EURO or GBP to see my financial data in that currency with my conversion rates?

 

sorry if this is just too hard...i can do it in sqlazure and create 10 additional columns and rows but surely this is what measures are for right??

 

thank you all so much in advance 🙂 🙂 🙂

 

Nikki

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@Nikki

You can use some measure like below. Check more details in the attached pbix.zip

converted sales =
IF (
    ISFILTERED ( conversionrates[To] ),
    SUM ( financials[sales] ) * MAX ( conversionrates[rate] ),
    SUM ( financials[sales] )
        * MAXX (
            FILTER ( conversionrates, conversionrates[To] = "USD" ),
            conversionrates[rate]
        )
)
//BY DEFAULT, it converts to USD 

Capture.PNG

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee

@Nikki

You can use some measure like below. Check more details in the attached pbix.zip

converted sales =
IF (
    ISFILTERED ( conversionrates[To] ),
    SUM ( financials[sales] ) * MAX ( conversionrates[rate] ),
    SUM ( financials[sales] )
        * MAXX (
            FILTER ( conversionrates, conversionrates[To] = "USD" ),
            conversionrates[rate]
        )
)
//BY DEFAULT, it converts to USD 

Capture.PNG

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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