Tableau very kindly has its own in built date hierarchy which means you get the behaviour shown above. Simply by have a date field in your data source, Tableau will break it up in to the hierarchy of Year -> Quarter -> Month -> Day -> Hour ->Minute.
To get a year -> month hierarchy you'd need to create your own custom hierarchy by creating a new calculated field that just stores the year and another that stores the month and then putting these in a hierarchy yourself.
You can create the calculated fields by following the instructions to create custom dates here, selecting the option of date part rather than date value
Then create you own hierarchy following steps in here
thanks Donna, how would the equation look like , "...create your own custom hierarchy by creating a new calculated field that just stores the year and another that stores the month and then putting these in a hierarchy yourself."
You do the following
1) create a custom date that stores your Year as per the instructions I linked to - you'll get a dialog like below.
3) Repeat 1 & 2 to create a Order Date Month field
4) Then create a new hierarchy by right clicking on the Order Date Year field, selecting Hierarchy -> Create Hierarchy. Call the hierarchy whatever is appropriate eg Order Date Year/Month or similar
5) Right click the Order Date Month field select Hierarchy > Add to Hierarchy > Order Date Year/Month (or just drag the Order Date Month field so its part of the hierarchy
6) You should end up with the below
When you then add Order Date Year to the rows shelf, you'll have the option to expand to show the months.