Forum Discussion
Variable in measure based on slicer selection
Hello dear community,
Merry Christmas to all.
I hope you are well.
I have a question.
I have different simple measures per country to convert the currency.
I would like that when I select the country via a slicer, the measure changes and the result changes everywhere (in the card and if I have a table with several countries, I see the sales by currency).
If I don't select anything, it will be $ by default.
Can you help me?
Thanks in advance for your help
Hi Anonymous
There are several options to work with FX rates, but just check one solution here:
https://www.dropbox.com/s/h8kqqr1emeg96tr/slicer_devise_%28allure-analytics.com%29.pbix?dl=0
Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.
Appreciate your Kudos !!!
7 Replies
- ALLUREAN
Solution Sage
Hi Anonymous
There are several options to work with FX rates, but just check one solution here:
https://www.dropbox.com/s/h8kqqr1emeg96tr/slicer_devise_%28allure-analytics.com%29.pbix?dl=0
Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.
Appreciate your Kudos !!!
- negi007
Community Champion
Anonymous let's say you have table below which has country name and conversion value
you can then create a measure that will extract the rate from the above table basis selection in the slicer for a country
Currency_convertor =var country_selected = SELECTEDVALUE('CURRENCY'[country])returnLOOKUPVALUE('CURRENCY'[rate],'CURRENCY'[country],country_selected)in the above visual, you can see basis selection value is being shown from table. You can customize the measure above to get the final value by calc using measure
- AnonymousNot applicable
Thnak you to you negi007 and ALLUREAN for your idea. It help me a lot.
I have a question based on that.
Imagine that I have a simple measure (if sales amount are between 1M and 2M then 1 if not0).
Is it possible to do this :
If I select Country the divide simple mesure by the disctinct count of country. If I choose region divide by distinct count of region, ... )
Do I do every time a measure for each case ?
- ALLUREAN
Solution Sage
Здраствуй Anonymous
You can download the file again. In this case the measure is using distinct static number of countries/regions, it can be dynamic if this is the case.
- AnonymousNot applicable
Hello Sir,
Thank you for your answer but I can't download the file :
Site is unreachable
- theov
Advocate III
This is in fact a must-know in BI solutions. This is explained fully in this video 🙂
Also, it helps better use SWITCH in DAX: