If you want a trend line, both pills need to be continuous. You can tell if a pill is continuous by its color, green means continuous, and blue means discrete. You can change numeric pills between these setting options from the pill's right-click context menu.
In the attached, I made this change and added the trend lines, and edited them so they are polynomial.
cublas_edit.twbx 12.5 KB
Brilliant. Thank you. Some of the other posts about trend lines in this forum talked about a discrete dimension. I probably misunderstood the posts and then assumed the independent values could be discrete.
I'm having trouble with this. I can't provide the workbook as it's linked to a corporate cube but hopefully the screenshots are enough.
First screenshot shows count over time. Trend lines are added no problem, despite one of the pills being discrete (month).
2nd screen shows similar information, but this time with a table calculation over time. Tableau refuses to add a trendline.
I have other examples where both pills aren't necessarily green but trend lines can be added - just this one (2.jpg) it refuses to add a trend line.
Take a look at the pill on your Columns shelf from both images, on the first, the pill is just "Month", just the dimension, and Tableau can treat dates in this way like it was continuous. In the other image, you have "MY(Month)", Tableau can only treat this as a dimension, and since trend lines require something continuous, trend lines cannot be shown.
One of many options you have is to create a calculated field like:
And then when you place the pill on the Columns shelf, set it to "All Values", and then you can have the trend line.