The reason this is happening is in the color swatch. Right now you only have center defined at 0. Now this will work when you have multiple items in you view, however when the is only one the range for start and end will automatically change to the range of the only displayed item. in this case 0.058 for both start and end leaving only 1 color to display.
I don't know how often this data changes, or if you have a set range you want the colors to band through but just by defining the end range to you max value will make your view work. Play around with the start and end ranges and you should get what you desire.
1 of 1 people found this helpful
This does make sense, although it is a bit confusing for sure. The Table Calc filtering "trick" does not apply here. That trick allows us to retain the values for each bar, but since only one is showing in the view, the legend has no way to know the full range of values for all markets. Or, that is how it made sense inside my own brain just now... but when I first looked at this, I thought: "That should work!" -- Now I see that its not quite the same issue as, say, this: A Jedi (Filter and Table Calc) Trick | Tableau Software
If you show all markets, then set the range of colors to be a fixed range, you can accomplish what you want--but then, your range is static. I could not find a way to make it dynamic.
Hope this helps a bit!
Thanks, Matthew and Jason. Yeah, I considered hard-coding the ranges, but that forces me into grading in absolutes. My workbook is actually dynamically merging recognized revenue with our forecasted/phased sales for booked orders and provides options for viewing future periods.
Thus, using static ranges doesn't really make sense. For example, if I wanted to see variance to target for the full year of 2014 today, every member of the dimension is going to be below, but that's not bad relative to where we are in the period. To get away from absolutes, I was hoping to grade them against peers, but it seems like that isn't possible directly.
It seems like I could base the color shelf on a percentile relative to peers though. I may try this. Just adding more complexity to an already complex dashboard!
I would just try to think about this from the "color legend perspective" . If your view is reduced to one Bar, the color range will never know the full range of values. The Table Calc "LOOKUP" filter does not help in this regard. I'm not sure there is a way to place a single pill on the color shelf to accomplish what you want--I will keep watching to see if anyone has a solution. I certainly won't say it isn't possible, because most things are--I just cannot see how it would work.
I think I understand limitations of the color grading. If I perform a table calculation partitioned by each member that force-ranks them (i.e. percentile or standard deviations away from the mean), then I can make an absolute static range along this calc that yields color relative to peers. Am I missing something?
I have no idea; I just can't envision it myself. Please do post back and show us if you are able!
I thought I'd check back on this post and see if anyone had found a solution to this. Maybe Jonathan Drummey Shawn Wallwork or Joe Mako has an idea how to get the calculation to work? I'm struggling with essentially the same issue. I want the color range to be set by 5 members in the view but I only want to display one of them. I've tried hiding, using First()/Last() to display only the desired value and it always resets the range.
For the project I'm working on the set of possible dimension members is very large (I'm using Category in the Superstore Sales dataset as an example) but the view will never compare more than 5 total, and the range for those could be VERY different from the set overall.
I found this post just before posting the same question myself and am hoping someone may be able to shed some new light on it. I put together a workbook where tab 2 shows the actual and desired outcomes.
Hoping to hear back some good news. Happy Friday!
Just found this notification in my spam filter. Are you still looking for help on this?
Thanks for following up. Yes, I would still like to find a way to calculate a color range before applying a Tableau calculation. I posted a workbook with an example use case. One reason this is needed is the client would like the workbook to display the Primary Category (in this case Paper) on a worksheet where the dimension value is visible and you have a 40% change in sales. Then on a separate worksheet display paper and a list of comps where the dimension values for the comps are aliased out. So you'd see Paper, Comp A, Comp B, etc. And in this instance you would see the YoY % change. Both of these sheets would go on a dashboard. This represents the first and third sheet that is displayed in my workbook.
Currently, because the color range is applied after the Tablea Calculation that does the filtering so I get view 2, which is the wrong color for the desired output.
Any suggestions you have would be greatly appreciated. Thank you in advance!
Looking at your wb, I would like to suggest
using a table calc for coloring when a filter applied.
Something like that in the attached wb.
You may use the original color palette
as the only visible one on a dashboard.
Hope this workaround may help.
PrimaryCategoryTest-Forums.twbx 698.0 KB
Thanks, Yuriy! This is great and it seems to do the trick. I'll try this out with the production data set and see how it goes. I really appreciate you helping me get this over the finish line.