Right now you have a hierarchy in your view that will do this.
If you hover over the quarter headers, you will see a - to collapse the months
If you hover over the year header, you will see a - to collapse the quarters
Now you will see + to expand the results.
Does that meet your need or do you want the dropdown still? That is also possible.
You will need to create a parameter for selecting what date segment you wish you see, and then a calculated field using a case statement to show what you selected. There's still a little formatting to resolve for the quarter and the month after you select them, but you should be able to do that. I changed the formatting by using DATENAME instead of DATEPART, and added "Q"+ in front of the DATENAME calculation for quarter to get the formatting.
I've attached an example built in Tableau 9.2.4, to show what I've done with the Superstore dataset. I hope it resolves your question.
Sorry for all the edits...
Thanks Ann! Yes, I was able to figure it out by creating a parameter (with dropdown choices for Year, Quarter and Month for the user to choose from ) and calculated field to utilize that. Below is from choosing quarter as drop down. My fiscal year starts in October, now I'm trying to figure out how do I do a conditional formatting that the label will show Q1, Q2, Q3 if they chose quarter, 2016 if they chose year and Month and Year (ex Jan '16, Feb '16, etc) if they chose month?
Very true Adam - that's what I get for working in a hurry.
Here's an updated version, with the corrected calculation... the only weird thing is that you'll have year at both the top and bottom of the visualization when year is the item that you select from the dropdown.
Yeah, I was just pointing out the difference. This basically does the same thing as the built in hierarchies, that's why I wondering if she knew it was there. Some people don't even notice the expand/collapse buttons.
It looks like she is also using a fiscal year, so the datepart is not going to be correct for years, quarters and months. Jan. Feb, Mar will return 1 but should be Q2 as an example.
I was being a little lazy.
Yeah, we're all guilty of being lazy from time to time - especially because I didn't notice Christine has a non-standard fiscal year there. If her date is already resolving with the breakout, then I believe the datepart (I'm using datename instead) should resolve properly. At least I think it should - I don't have a non-standard fiscal calendar to test that out to be sure.
Christine, let us know what happens when you try this out.
Sorry I missed your reply Christine! I've got you part of the way with the quarter in my latest workbook, but here's the updated case statement:
When "Year" THEN DATENAME('year',[Order Date])
WHEN "Quarter" THEN "Q"+DATENAME('quarter',[Order Date])
WHEN "Month" THEN left(DATENAME('month',[Order Date]),3)+" '"+right(DATENAME('year',[Order Date]),2)
That will get you the 3 letter month and the 'YY that you want. At least I hope that works when you plug it in.