The problem is that since the workbook is using the FIXED method from Re: How can I find the up or down direction of a Trend Line? <https://community.tableau.com/message/387612#387612> we must use context filters, otherwise the FIXED LODs are computed before the filters are applied. Here’s the relevant set of notes from my original post:
A FIXED vs. INCLUDE/EXCLUDE tangent:
When I first started using LOD expressions I was all about the FIXED. With a little more practice now I generally prefer using INCLUDE & EXCLUDE. There are two reasons why:
- FIXED calcs are invariant to the dimensions in the view. If I want to swap out Customer Segment for Region & Order Priority then I've got to make a number of edits, whereas in the INCLUDE/EXCLUDE option (still to come) or table calculation solution all I need to do is drag & drop pills.
- FIXED calcs are only filtered by context filters & data source filters, so I have to remember (or in the case of helping others remind them) to turn any existing filters into context & data source filters. That's an extra set of steps that break my analytical flow.
I haven’t evaluated every calculation to make sure that they are right, however here’s a screenshot showing that when I add all the filters to context the Slope calc is returning -0.1807 vs. the Tableau trend line of -0.1811, so they are pretty close!
PastedGraphic-1.tiff 271.5 KB
Okay thanks Jonathan -- The context filter reference must have been obscured by all the math I was taking in!
Thanks for that original post!!