Hello Tableau Community,
What I am trying to accomplish seems straight forward, but having a hard time implementing. Basically, I want to provide users the ability to compare a metric (volume) month over month. I created a parameter that allows the user to select either "MoM (Most Recent)", which takes the most recent month in the data set and compares to the previous month, or select "MoM (User Defined)", which they can chose 2 months to compare. I am able to implement the Most Recent option without issues, but it's the User Defined option that I'm having a difficult time with.
I have attached the sample workbook, which is pretty straight forward - 1 dimension MONTH and 1 measure VOLUME.
MoM (Most Recent)
- Again, pretty straight forward ... created a calculated field using the FIXED LOD to derive the max month in the data set, which allows me to identify the Latest volume, Previous volume and % difference between the two.
MoM (User Defined)
- I want to accomplish the same thing as above, but this time allow the user to define which 2 months to compare.
- I know the issue has something to do with the ATTR() function - I'm just not fully understanding how best to take the aggregated month fields, which determine the MIN and MAX months in current view, and filter the volume results.
Sheet 1 illustrates how I am able to identify the max month in the data set, as well as the Min and Max month if the view (you can toggle the months on the right to see how the User defined months change).
Sheet 2 illustrates how I am able to identify the Latest (based on Max month in data set) and Previous month's volume in order to compare MoM. However, unable to accomplish this with the user defined metrics, which are aggregated dates. Ideally, I'd have this in one metric, but I have it broken out for troubleshooting purposes.
Any help is greatly appreciate. Please let me know if you need clarification on anything.
Book1.twbx 52.1 KB