Hi,
I have a Date filter, Month and year, i am showing the last month filter ex: showing the July 2026 data in Aug 2026 month , meaning previous month, if i use the relative filter as previous month in the filter, will the filter in the date(MY Month) will automatically change when month is changed ?? using this relative filter previous month automatically change the filter value in the next month, ex: Sep, it will automatically select the aug 2026 data when month starts. Anyone please clarify, Thanks
#Tableau Desktop & Web Authoring #Reports & Dashboards #Tableau #Formulas #Tableau Prep
This can be done by creating the below calculation, using LOOKUP() function:
For now, both July and August are in the view just so you can see that July's data for Quantity now lives in August's 'date', as shown above. But, we don't want to have to select two month's data at a time and yet, two month's of data MUST be in the view. somehow.
So, we then change the Order Date filter that you originally had into again, a Relative Date filter, again displaying only most recent two months, as I did before:
Then, the question remains, how to show just the current month, but only with last month's data in the current month. Again, another filter. BTW, both of these are Table Calculations, so certain fields must be in the view somewhere in order for them to all function correctly and display correctly. The new calculation will now filter the above result to only the last row in the view:
It is placed onto the Filters Card and in the dialog that pops up, it is set to TRUE. So that you end up with a single row of data displaying the most current month's 'date' with the prior months 'data':
Example workbook attached. Again, these are table calculations, meaning they can be challenging to work with. So, if you add additional dimensions, certain settings might need to be adjusted depending on what you end up actually doing with this method - that is accomplished by right-clicking the table calculation in the view and selecting Edit Table Calculation.
As to it being automatic and adjusting for next month, it should based on the Relative Date filter..it would automatically adjust to September and pick up August's data. And so on.
If this response answered your question, please mark it as an Accepted Answer?
This way, others searching for similar solutions will find the answer faster in the future.
Best, Don Wise (Tableau Ambassador)