It sounds like you've followed these steps - Swapping Measures Using Parameters | Tableau Software
But it's pretty difficult to give you good advice for the next steps as I don't know what "isn't working" for you. Can you perhaps create a sample and upload a Tableau Packaged Workbook so I can replicate?
As Tom Said, that is working fine.
1. create a parameter (Sales_or_ShoppingCost) with 2 staring values
Sales_or_ShoppingCost : Sales, Shipping Cost
2. create a calculated field (Measure_Sales_r_SC) as below
IF [Sales_or_ShoppingCost] = "Sales" THEN [Sales]
ELSEIF [Sales_or_ShoppingCost] = "Shipping Cost" THEN [Shipping Cost]
Yes I did follow those steps, and it is working correctly, the issue I am having is that what i am trying to achieve is slightly different to the example above.
I have attached a sample workbook.
What I have is a graph where I want to be able to change the x axis to a different 'Metric' dimension. The issue is that some of the measures are calculated fields and some of them are measures and the calculations I have tried don't account for this so I am getting the incorrect numbers. If anyone knows a way of getting past thins then please let me know.
Comparison graph - SAMPLE.twbx 881.4 KB
the calculations I have tried don't account for this so I am getting the incorrect numbers
You need to provide more details on this - where are they incorrect? What's the current result and what's the expected / actual result?
I think the issue you are facing is around the lack of a [Measure Name] field/variable that you are able to pull into the calculation editor window. In order to change the measure that you are reporting using a parameter, you will have to use the CASE stataement used in that example..
CASE [Placeholder 1 Selector]
WHEN "Discount" THEN [Discount]
WHEN "Order Quantity" THEN [Order Quantity]
WHEN "Profit" THEN [Profit]
WHEN "Sales" THEN [Sales]
WHEN "Unit Price" THEN [Unit Price]
Hope that Helps.