I've got a SQL query that eventually outputs monthly retention by N months and by initial cohort date. The calcs are done in SQL because it's easier than loading in a few million rows into Tableau and doing the calculations on a per user basis within the app.

I'm able to make a graph in Tableau & in Excel/Sheets that shows m1, m2, m3, mN retention with the initial cohort month as the X-axis. However, my internal customers want the x-axis to be the m1, m2, mN cohort to be the x-axis and the date to be grouped by the initial cohort month.

In Excel/Sheets I can swap rows/columns and the graph I want is created quite easily. However if i do the same in Tableau the horizontal graph just turns into a vertical graph, which isn't what I want. Transposing the initial data lets me build a table that I want, but when I try to graph it the x-axis goes null because "m1_cohort_month" isn't a "time" and isn't graphed properly in Tableau.

Any idea how I can either prep my data differently or generate the viz I'd like?

This did the trick, I thought pivoting it might be the answer. My first attempt at pivoting did not yield this clean of a result when I graphed it, somehow the x-axis was going to 1900 as the "year" like below.