Do your users want to filter your dashboard by the Days, Weeks, Months and Years? I like to create a set of buttons as shown below with D, W, M and Y for this. Visually it does not take up a lot of room, and this is another option for your clients instead of using a boring old filter.
Date "Button" Example:
![](https://static.wixstatic.com/media/fb3a64_cdf2a1d0595f42bf82d3a6ab4caf7ceb~mv2.jpg/v1/fill/w_740,h_64,al_c,q_80,enc_avif,quality_auto/fb3a64_cdf2a1d0595f42bf82d3a6ab4caf7ceb~mv2.jpg)
To put it into context, I use this button to filter the axis in the below line chart. The user can see the line graph by the date increments.
![](https://static.wixstatic.com/media/fb3a64_1124175da93e4162ad0819074cdef2f9~mv2.jpg/v1/fill/w_980,h_593,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/fb3a64_1124175da93e4162ad0819074cdef2f9~mv2.jpg)
In order to create these buttons, I start with creating the following Parameter.
Date Part Example
![](https://static.wixstatic.com/media/fb3a64_3ac40b9303ca49bf96153993a891eb77~mv2.jpg/v1/fill/w_406,h_450,al_c,q_80,enc_avif,quality_auto/fb3a64_3ac40b9303ca49bf96153993a891eb77~mv2.jpg)
I create a Calculated field as shown below on the sheet with a line graph.
Date with DATETRUNC
Date(DateTRUNC([Date Part Example],[Order Date]))
I will use this calculated field to replace the Order Date field in the Columns shelf.
I then create an Excel spreadsheet with the following;
![](https://static.wixstatic.com/media/fb3a64_8039c71efe1a4963b8402eb7353c6400~mv2.jpg/v1/fill/w_270,h_123,al_c,q_80,enc_avif,quality_auto/fb3a64_8039c71efe1a4963b8402eb7353c6400~mv2.jpg)
I save this as a Control Sheet.xlsx
I connect it to Tableau and format it as below;
![](https://static.wixstatic.com/media/fb3a64_dd3bae1e0eed40898d5d6214b80db85c~mv2.jpg/v1/fill/w_481,h_396,al_c,q_80,enc_avif,quality_auto/fb3a64_dd3bae1e0eed40898d5d6214b80db85c~mv2.jpg)
On the Columns shelf, I right-click to create a new calculation.
I then type Min(1)
This will change the worksheet to a bar chart and appear as below;
![](https://static.wixstatic.com/media/fb3a64_3cae843069974725ac69a15354f1cf73~mv2.jpg/v1/fill/w_980,h_171,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/fb3a64_3cae843069974725ac69a15354f1cf73~mv2.jpg)
I then right-click on the axis to edit it and give it a Fixed end of 1.
![](https://static.wixstatic.com/media/fb3a64_69f513b455bd46038cf7b2b7796f9784~mv2.jpg/v1/fill/w_459,h_659,al_c,q_80,enc_avif,quality_auto/fb3a64_69f513b455bd46038cf7b2b7796f9784~mv2.jpg)
This will expand the bars all the way across the pane.
I then hide all the Headers.
I remove all the grid lines, pane lines etc.
I move the Date Part Value measure to the Color Marks card.
I change the alignment for the Text to Middle by clicking on the Label Marks card. I also adjust the size of the Font, and make it bold.
I also expand the worksheet to display as the Entire view.
I right-click on the Date Part Display pill in the Columns shelf and set the sort to Manual. I move the M value below the W value.
![](https://static.wixstatic.com/media/fb3a64_460325a249dd4fad965ed3fc2f1fe40b~mv2.jpg/v1/fill/w_296,h_409,al_c,q_80,enc_avif,quality_auto/fb3a64_460325a249dd4fad965ed3fc2f1fe40b~mv2.jpg)
Now I place this sheet on the dashboard.
I go to the Dashboard menu and select Actions.
I create a Parameter action by selecting the Add Action button and selecting Change Parameter.
I configure the Parameter as follows;
![](https://static.wixstatic.com/media/fb3a64_af9224029f7c4d269bcab49758893943~mv2.jpg/v1/fill/w_502,h_532,al_c,q_80,enc_avif,quality_auto/fb3a64_af9224029f7c4d269bcab49758893943~mv2.jpg)
I then click OK when all the values are set like the example above.
I am now be able to change the axis of the line chart with the different Date "buttons."
I have this example for you to download in my Tableau Public dashboard here.
Comments