As measure 1 and measure 2 require separate logic for the colour formatting, having one marks card for both measures with one item on the colour shelf won't work.
You would need separate calculated fields to determine the colour for each measure, then have a separate axis for each measure in the view to get two marks cards onto which you can put your separate colour fields. i.e. use dual axis.
(NOTE to synchronise the axes you would need to convert measure 2 to a float)
See attached workbook
Blended Axes.twbx 16.6 KB
Good point on the single marks card, Steve. The dilemma I am having is I was interested in combining the Blended Axes with a Dual Axis to create a lollipop chart as per below. So, in this configuration, I already burn my dual axis to create the separate marks. Do you think I am faced with an either-or situation? Either I use dual-axis to logically format each measure, or I use the dual-axis to create the lollipop, but lose my ability logically format each measure?
1 of 1 people found this helpful
I had a feeling the real-world application would be more complicated than the attached workbook!
I'm happy to be proven wrong but I don't think using measure names/measure values in this respect will enable the unique colour formating per measure.
IF you were to pivot the data before hand in the data source window (so you get Pivot Field Names and Pivot Field Measures fields) that might enable you to say something like:
// new field called Target
CASE [Pivot field name]
WHEN 'Measure 1' THEN 99
WHEN 'Measure 2' THEN 98
to get a target per measure then you could have a single calc field for colour that says
IF [Pivot Field Measures] >= [Target] THEN 'Green' ELSE 'Red' END
Is that something you've tried already? I'm going to give it a go and see if it works....
Seems to work.
Depends on your datasource whether you can use the tableau pivot function (flat files like excel/google sheets etc are fine). If it's a SQL datasource you can do the same thing but using unions for each measure. Let me know if you want me to run through that.
Blended Axes.twbx 26.9 KB
That will work! I can carve-out the data I need from source and pivot appropriately. Great job, thanks for the help!
You're very welcome, glad it works for you.