0
votes

I am creating a dashboard that shows the last 7 days of data as shown below

https://i.stack.imgur.com/lmSLS.png

However, if the user filters for a specific date lets say March 6, I need to show data for the previous 7 days starting Mar 6 (Feb 28 - Mar 6). How could I get this built in a Tableau dashboard to have the last 7 days change dynamically depending on the user actions.

1

1 Answers

0
votes

You can create a parameter for dates. Select data type date, allowable values list, and add it from your date field. Right click on this parameter, and select Show parameter control option.

Then, generate a boolean calculated field using this parameter, something like:

DATEDIFF('day',[Your Date Field],[Date Parameter])<7
AND DATEDIFF('day',[Your Date Field],[Date Parameter])>=0

Drag this field to filters, and select only True values.