Forum Discussion
Current Best Practicies - Switch Dollar and Unit in Visual
Hi all,
it seems like there are some exciting updates / features that allows us now to easily switch visuals from a unit to a dollar display etc.
In my scenario, I have a data model with a single transactional table, that contains for each sales order 4 different columns with values values in units and 1 column with the individual costs per unit for each order:
| Order | Value 1 | Value 2 | Value 3 | Value 4 | $ |
| 1 | 10 | 15 | 5 | 60 | 5 |
THen I have a matrix visual in the report the displays these units for each department as a sum.
Now I would like to add a slicer to select Units or Dollars to display the values in units or units * $.
How would you do that?
- SWITCH Measure for each column in the matrix?
- Calculated groups?
- Bookmark with 2 visuals?
Any thoughts on that?
5 Replies
- Idrissshatila
Super User
Hello joshua1990 ,
You could do that using field parameters ( same as calculated groups), I think its a best option.
https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parametersIf I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- joshua1990
Post Prodigy
Idrissshatila Thanks. Could you please explain the total approach? Calculated columns for both Units and Dollar? Add these columns as a Field Parameter then? How can I easily switch then from dollars to units all at once?
- miTutorials
Super User
If i understood your request correctly the below tutorial should be helpful in terms of selecting which column to display in your visual.
- Idrissshatila
Super User
Hello joshua1990 ,
so, you create a new column to calculate the values in another currency, the make a field parameter that has the first currency value column and the new column.
then in the matrix you put the value of the field parameter and you'll a slicer that has the two columns currencies to switch with and the values would easily switched between the two columns.If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
- joshua1990
Post Prodigy
Idrissshatila Thanks. But as I mentioned, there are 4 columns with units. So the field parameter would have 8 columns in the end, right? I don't want to select the columns in the end, I would like to switch the values.