I really confused to make this visualization. I wanna combine bar chart and line chart but i have 4 measure and the axis consist month-year like this viewAnd i have tried like this pic but the line chart become a dot only and cannot to be line chart.
Anyone please help me!
Hi @Lathifah Aliya
You won't be able to use two dual axis both based on Measure Names/Value, so first of all I'd pivot the data:
(ref: https://help.tableau.com/current/pro/desktop/en-us/pivot.htm)
How I can create calc to only return a value for the bars:
And then similarly for the lines:
And then I can right click on that second pill on Rows and select dual axis (I also have to change back to bars, synchronise the axis, and drag measure name off colour on the all marks card):
Now we're at the point where we can think about unstacking the bars and showing them side-by-side. And the instructions in previous posts should help with that. We need to have a continuous (green) axis for the dates which means converting your data to an actual date. I'm going to use DATEPARSE here and assume current year:
I then create a calc "Offset" which says -10 (days from the month) for measure 1, and +10 (days from the month) for measure 2. And I put that on Size on the Marks card for the bars. This puts the bars side by side:
They are still stacked though (the blue bars don't start from 0). So from the Analysis menu I go to "Stacked Marks" and select "Off" to get:
Hmm. What happened to "September"??? Tableau for some reason (they described it as "for the Global client") decided to make Sep no longer short for September. I'll just update my "Month (as date)" calc to handle this:
So that's one step-by-step way to do what you describe. I'll attach the workbook so you can take a look (I had to save as a more up to date version though I'm afraid!). Let me know if it helps!
Ta, Steve