How to display data for last few days but cumulate records from beginning of time in Tableau

141 Views Asked by At

I am building a Bar graph in Tableau to show daily cumulative record since January 2018. Due to number of days elapsed since then, the bars are so crunched that it looks ugly.

That said, how can I only display data for last few days while retaining the actual YTD count.

For e.g. starting January 1st I had 0 logins, February 1st - 100 YTD logins, March 1st - 200 YTD logins, April 1st - 300 YTD logins, and May 1st 400 YTD logins. I want the graph to display bars from May 1st only and show the starting count as 400 YTD logins and not zero.

PS: I am new to Tableau, so please assume that I don't know advanced stuff.

2

There are 2 best solutions below

2
On

If you manually change the axis range, all table calculations, such as running totals, remain unaffected. You can do this by right clicking on the axis header, selecting "Edit Axis", then selecting the "Fixed" option under "Range", and choosing the dates you want to show.

0
On

It seems that you are using Fit Width option which forces everything to be shown in your screen width. If so, try changing this to Standard, so that you may have control on the width of your bars and your users can see every month in one viz with a horizontal scrollbar.

enter image description here

If you do not want a scroolbar'd solution, you need to create fixed calculated fields to not get effected by the filters and use those new fields in your graph. At this point you may filter the date automatically (again with a calculated field based on the current date) or make your users manually filter what they want.

We may be in some more help if you can send a sample workbook but also you may play around with LOD expressions, FIXED keyword or simply get your calculations between { and } to fix them globally.