The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
so, I have a simple task that turned out to be a nightmare...
I have three columns
CustomerCurrValue | Currency | SystemCurrValue (in CZK) |
35 | PLN | 5,8 |
25 | USD | 10 |
15 | PLN | 2,5 |
10 | USD | 0,4 |
What my customer is asking me to do is to create a column chart with a slicer, where he switches currency and the column chart shows the sliced values formatted to the sliced currency. If he selects USD, he gets 35 USD, if he selects PLN, he gets 50PLN.
At the same time there will be a table, which will display 2 columns the first displaying Customer Currency Value and the second System Currency Value .
At first, I thought I would use format() but that worked only for tables and matrixes, once applied to another kind of chart, it fails, because the value is in string format...
Next, I tried to use calculated groups, according to this video, but it formats all the measures (including the system currency), which is unwanted for the table visual...
Any suggestion for a simple way to do this?
Cheers!
Solved! Go to Solution.
Change the IF statement so that the else clause returns SELECTEDMEASUREFORMATSTRING().
Calculation groups is the way to go. Inside the format string expression you can use SELECTEDMEASURENAME to control which base measures will be affected. You can also create a calculation item called e.g. "no formatting" which does not apply any formatting, and use that calculation item on your table.
When I used the following code:
It worked fine for the CustomerCurrValue (Sales Frgn), however it broke the formatting of the Sale (SystemCurrValue)... It just kept it to basic number formatting...
Any further suggestions?
Change the IF statement so that the else clause returns SELECTEDMEASUREFORMATSTRING().