1 of 1 people found this helpful
As your data is structures such that you have a column for each month of measure data you will need to pivot it to get the desired result (or change the structure in the data source). Here are the instructions to pivot your data in Tableau Desktop:
- Clear your existing worksheet
- Select 'CY01' and shift-click 'PY 12' (to select all measures).
- Right-click > Hover over 'Transform' > Select 'Pivot'
- This will leave you with 1 dimension (Pivot Field Names) and 1 measure (Pivot Field Values)
- Right-click 'Pivot Field Names' > Hover over 'Transform' > Select 'Split'
- Drag 'Pivot Field Names - Split 2' to columns
- Drag 'Pivot Field Values' (measure) to rows
- Drag 'Pivot Field Named - Split 1' to Color
Hope this helps,
If this posts assists in resolving the question, please mark it 'helpful' and/or 'correct answer'. This will help other users find the same answer/resolution. Thank you!
Your data needed a bit of change in order to accomplish what you're looking to complete. Tableau won't recognize CY vs PY labeling as 2017 vs 2018.
Your underlying data therefore needed to be changed accordingly so that CY-01 = January 2018, CY-02 = February 2018 and correspondingly PY-01 = January 2017, PY-02 = February-2017.
Thereafter, due to the way the data is shaped/structured, it additionally needed to be pivoted, selecting all columns (right-click) and then select Pivot:
Which results in the following changes to the view:
Field Names were then both changed/recast to be a date field (click on the abc icon and then select Date) and further renamed to Dates; (right-click) and select Rename:
After that it was simply dragging and dropping the fields into the following order to get to this view:
Hopefully it's what you're looking to do? If yes, then please close this thread by marking this response as correct. 2018.2 workbook version attached. Thx, Don
CY vs PY chart.twbx 62.7 KB