Yes we should be able to do this...just one quick question!
Are the New Visitors included in the Vistors number? So if we had 100 New Visitors and 200 Visitors...would that be 50%/50% or 33%/66%?
Amazing thanks a lot!
And good question: "new Visitors" are included in "visitors", so out of 200 visitors you would have 100 new visitors, so 50%, 50%.
Thanks for the info!
So hopefully this does the trick...
first thing...if we want to stack different measures onto a chart, we need to use the (Tableau generated) measure names/values, which act like pseudo-dimensions and measures for measures.
So in order to make these %ages...I first created the %age of new visitors
[%age New Vistors]
and the to get the remainder (non-new)
[%age Non-New Vistors]
As aggregate calculations, they are calculated at the level in the Viz...in this case Day, but if you looked by week, month...etc. it would remain correct.
Hope that helps, and makes sense.
OK...So you just need to replace the colour, currently on SUM([Visitor Numbers]), with the measure names. This will add measure names (the 2 you have selected) to the VizLoD and so stack the bars. You can actually just add it to the detail pane, but both bars would get the same colour (although you can, if you turn on bar borders, just about see them).
Great - this worked. Thanks! Now I am only wondering how to make Tableau “new visitors” part of “visitors” and not individual bars that are staked on top of each other.
I thought the stacking and 100% was what we were trying to do here!!?
Anyway both the calculated fields I provided are divided by Visitors so we get %ages, and then stacked to makeup 100%.
So we can just use the first part to get this...
[Visitors - Existing]
and then [Vistors New] you already have (using SUM)...and so stacking these 2 measures will give the total height of the stacked bar being that of total visitors...where the new will be a different colour.
Hope that makes sense?