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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Currency Conversion of data in different currencies

I currently have a table which comes in the format as shown in the table below (Raw data image). The UK data in represented in GBP and the data from Ireland is represented in EUR.  I would like to create a currency measure which converts all of the data into one currency. i.e either GBP OR EUR in one column. The results image below shows the actual results based on the currency. I tried to create a  measure (currency measure image) based on the dates and currency selected to covert my raw data into either currency,  however it does not seem to work. Can anyone assist or advise on the best approach for this?

Raw data TableRaw data TableResults TableResults TableCurrency MeasureCurrency MeasureExchange Rate usedExchange Rate used

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

According to my understand, you want to calculate the Actuals * Rate based on selected value in Slicer, right?
You could use the following formula:

Measure =
SWITCH (
    MAX ( 'Table'[Country] ),
    "Ireland",
        CALCULATE ( MAX ( 'Rate'[Rate] ), 'Rate'[Repo] = "GBP" )
            * MAX ( 'Table'[Actuals] ),
    "UK",
        CALCULATE ( MAX ( 'Rate'[Rate] ), 'Rate'[Repo] = "EUR" )
            * MAX ( 'Table'[Actuals] )
)
Measure 2 = 
var _sele=SELECTEDVALUE('Rate'[Repo])
var _rate=CALCULATE(MAX('Rate'[Rate]),'Rate'[Repo]=_sele)
var _country=IF(_sele="GBP","Ireland",IF(_sele="EUR","UK"))
return CALCULATE(MAX('Table'[Actuals]),FILTER('Table','Table'[Country]=_country)) *_rate 
Measure 3 =
IF ( [Measure 2] = BLANK (), MAX ( 'Table'[Actuals] ), [Measure 2] )

The different visualizations look like this:

10.19.3.1.gif

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

Best Regards,
Eyelyn Qin

 

View solution in original post

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

According to my understand, you want to calculate the Actuals * Rate based on selected value in Slicer, right?
You could use the following formula:

Measure =
SWITCH (
    MAX ( 'Table'[Country] ),
    "Ireland",
        CALCULATE ( MAX ( 'Rate'[Rate] ), 'Rate'[Repo] = "GBP" )
            * MAX ( 'Table'[Actuals] ),
    "UK",
        CALCULATE ( MAX ( 'Rate'[Rate] ), 'Rate'[Repo] = "EUR" )
            * MAX ( 'Table'[Actuals] )
)
Measure 2 = 
var _sele=SELECTEDVALUE('Rate'[Repo])
var _rate=CALCULATE(MAX('Rate'[Rate]),'Rate'[Repo]=_sele)
var _country=IF(_sele="GBP","Ireland",IF(_sele="EUR","UK"))
return CALCULATE(MAX('Table'[Actuals]),FILTER('Table','Table'[Country]=_country)) *_rate 
Measure 3 =
IF ( [Measure 2] = BLANK (), MAX ( 'Table'[Actuals] ), [Measure 2] )

The different visualizations look like this:

10.19.3.1.gif

Here is the pbix file.

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.

Best Regards,
Eyelyn Qin

 

lbendlin
Super User
Super User

Please be more specific. What have you tried and where are you stuck?

Anonymous
Not applicable

Essenitally i would like to create a measure in which if EUROs is selected then you would only convert the UK actuals value into Euros and if GBP is selected you would only convert the Ireland actuals value into pounds.  

" if EUROs is selected " - How? In a disconnected slicer?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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