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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

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

Example 

1 ACCEPTED SOLUTION
ALLUREAN
Solution Sage
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 !!!

https://allure-analytics.com/




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




View solution in original post

7 REPLIES 7
theov
Advocate II
Advocate II

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:

https://www.youtube.com/watch?v=tljRYGz15PA

Anonymous
Not 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 ? 

 

 

 

Здраствуй @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.




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Anonymous
Not applicable

Hello Sir, 

 

Thank you for your answer but I can't download the file : 

Site is unreachable

it should work:

https://www.dropbox.com/s/h8kqqr1emeg96tr/slicer_devise_%28allure-analytics.com%29.pbix?dl=0

 

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




negi007
Community Champion
Community Champion

@Anonymous let's say you have table below which has country name and conversion value

negi007_0-1640523335519.png

 

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])
return
LOOKUPVALUE('CURRENCY'[rate],'CURRENCY'[country],country_selected)

 

 

negi007_1-1640523407499.png

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




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

ALLUREAN
Solution Sage
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 !!!

https://allure-analytics.com/




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors