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.
Dear Community,
I am working on a report where the users should be able to switch between 3 different currencies.
I have created a simple table (CurrencyMeasure) and the following DAX command to support a currency slicer on the report page:
Solved! Go to Solution.
I think you should be able to use SELECTEDMEASUREFORMATSTRING() as the default in a SWITCH statement, so unless you explicitly specify a new format string for a measure it will use its original setting
Hi @johnt75,
Thanks great feedback. I have looked into using Tabular Editor with Calculating groups. However, it tends to format all measures (some which are not currencies) when I use SELECTEDMEASURE(). Do you know a way around this?
Thanks in advance.
The format expression itself can be DAX, so you could put a SWITCH( SELECTEDMEASURENAME() in there and return different format strings dependent on which measure was currently in context
Hi @johnt75 ,
When I try to use either SWITCH or IF I am able to format the selectedmeasures, however I can find a way to keep the normal format for all other measure. I have a table where I want the Calculated group to format some columns with Sales and Budget but the rest of the measures should keep their normal format.
How do I do that?
Thanks in advance.
I think you should be able to use SELECTEDMEASUREFORMATSTRING() as the default in a SWITCH statement, so unless you explicitly specify a new format string for a measure it will use its original setting
Hi,
Thanks a million. I got it solved with the SELECTEDMEASUREFORMATSTRING()
You could use a field parameter. Create separate measures to return the value in the appropriate currency, each of which you can then format properly. Add all the measures to a field parameter and the user can choose between them.
Hi @johnt75,
Thanks for the answer. The user should be able to change more then just the currency of Net Sales, also Buget and Forecast. Would that be possible using field parameter? I havent really played around with that feature yet.
Thanks in advance.
If there are multiple different types of measures to change then a fields parameter is probably not the best option, you might be better off with a calculation group as that would work with any measure you passed in to it, simply perform the currency conversion on the results of SELECTEDMEASURE(). It is also possible to have different format strings for different calculation items
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
75 | |
52 | |
46 | |
15 | |
12 |