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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Multiply values in visual according to slicer selection (Currency slicer)

Hi, this is my first message on this forum.

 

As stated in the title, I need to create a visual that works with a currency slicer. When a currency is selected from the slicer, it looks up the correct exchange rate and multiplies the USD amount in the visual with that exchange rate for a successful currency conversion.

 

Data relevant for this task:

- 'CurrenciesDim' containing [RateUSD] with the exchange rate from USD and [Currency] acting as an ID.

RLaurila_0-1618916807157.png

- 'Invoices' containing [Amount] (currency is USD by default) and [InvoiceID]

 

'Invoices' *:1 'CurrenciesDim'

 

I've created the following measures for currency filtering

[AllAmount]: a sum of 'Invoices'[Amount])

[SelectedCurrencyValue]: used to bring up the exchange rate selected in a slicer, and if nothing is selected, it's USD)

SelectedCurrencyValue = IF(
HASONEFILTER('CurrenciesDim'[Currency]),
LOOKUPVALUE('CurrenciesDim'[RateUSD],'CurrenciesDim'[Currency],
VALUES('CurrenciesDim'[Currency])
),
LOOKUPVALUE('CurrenciesDim'[RateUSD],'CurrenciesDim'[Currency],"USD")
)

As well as [Relative], which is supposed to be an amount that is in accordance with the currency selection:

Relative = SUMX('Invoices',[All Amount]*[SelectedCurrencyValue])

However, when I create a visual showing the amount in a selected currency, the visual only works when the slicer selection is "USD" or none.

RLaurila_1-1618916807163.png

 

If I select some other currency, the visual goes blank.

RLaurila_2-1618916807168.png

 

I would appreciate any help or ideas 😄 Thank you in advance, love from Finland!

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

Hi @Anonymous ,

 

Based on my test, the [Currency] for slicer will affect your [AllAmount] measure since there is a relationship between the two tables:

relationship.PNG

So I suggest you delete the relatiohship.

Then try the following formula:

AllAmount = SUM(Invoices[Amount])
SelectedCurrencyValue = 
var _curr=IF(ISFILTERED('CurrenciesDim'[Currency]),MAX('CurrenciesDim'[Currency]),"USD")
return CALCULATE(MAX('CurrenciesDim'[RateUSD]),FILTER('CurrenciesDim','CurrenciesDim'[Currency]=_curr))

//Or
//IF(ISFILTERED('CurrenciesDim'[Currency]),MAX('CurrenciesDim'[RateUSD]),1)
Relative = [SelectedCurrencyValue]*[AllAmount]

The final output is shown below:

rate.gif

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on my test, the [Currency] for slicer will affect your [AllAmount] measure since there is a relationship between the two tables:

relationship.PNG

So I suggest you delete the relatiohship.

Then try the following formula:

AllAmount = SUM(Invoices[Amount])
SelectedCurrencyValue = 
var _curr=IF(ISFILTERED('CurrenciesDim'[Currency]),MAX('CurrenciesDim'[Currency]),"USD")
return CALCULATE(MAX('CurrenciesDim'[RateUSD]),FILTER('CurrenciesDim','CurrenciesDim'[Currency]=_curr))

//Or
//IF(ISFILTERED('CurrenciesDim'[Currency]),MAX('CurrenciesDim'[RateUSD]),1)
Relative = [SelectedCurrencyValue]*[AllAmount]

The final output is shown below:

rate.gif

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Evelyn,

 

It works exactly like you demonstrated. Thanks a lot for the help, this issue has been bugging me for quite some time now. Have a nice day!

Helpful resources

Announcements
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.