Forum Discussion
Control which currency is displayed with slicer
- 10 years ago
Hi jpapador,
Yes, this is possible. Let’s take an example to explain how it would work:
First we need to build a new table named as Currency as below:
CurrencyName
Rate
Symbol
US dollar
1
$
Euro
0.88
€
RMB/CNY
6.65
¥
Russian Ruble
64.88
₽
Here we take use of US dollar as the basic currency rate, CurrencyName in Currency table as the Slicer option:
Then under each table, when using columns with currency(Sheet2[sales] as an example here), create a new measure in the format below:
Currentsales = IF(
ISFILTERED('Currency'[CurrencyName]),
sum(Sheet2[sales])*VALUES('Currency'[Rate]),
sum(Sheet2[sales])
)
And if you would like to show the Currency Symbol, write another measure as below:
CurrentSymbol = IF(
ISFILTERED('Currency'[CurrencyName]),
values('Currency'[Symbol]),
CALCULATE(values('Currency'[Symbol]), 'Currency'[Rate]=1)
)
See the result under Power BI desktop:
If any further help needed, please feel free to post back.
Regards
Hi pgarcia,
I guess you did it via If function in Measure, it would help if you include FORMAT function https://msdn.microsoft.com/en-us/query-bi/dax/format-function-dax.
Unfortunately that is not solution for me :).
BR
Pavel
Hi JorisVoorn
Thanks by your reply.
I've built the measure with format. My measure is:
Measure Select = SWITCH( true(); VALUES( 'Dim Currency'[CurrencyDesc] )= "EUR" ; format([Value_EUR];" #,### €");
VALUES('Dim Currency'[CurrencyDesc] )= "USD" ;format([Value_USD];"#,### $"))
Best regards