5 Replies Latest reply on Apr 3, 2015 7:15 AM by Bill W

# Display the most recent data based on Days.

Good morning my Tableau friends, I am struggling with an issue here.

I am trying to display the most recent data in terms of days per a category. Here is what I've tried. I first changed the date field to a string in order to display the Last() row of data, which it works, however, it doesn't give me an accurate Grand Total. In my attachment below the total should be 7,218 not 168,095.

I was wondering if there is anyway to create a last available day calculation? I used this one in the past to display the last data point of the month for Sales. -  If datediff('month',[Order Date], Today()) = 1 Then [Sales] end - This seems to work well, since the next month will always present itself. However, I cant seem to wrap my mind around how to do it for Days, since the days the data comes in can be on different days, its not continuous (as per the example, a bunch of different days of data). Additionally, using the relative filter doesn't work either, because I need to see the whole year for other data points that are on the sheet. However, for just the sales data, I only need to see the most recent available day.

• ###### 1. Re: Display the most recent data based on Days.

Hi bill,

In your workbook shown running sum of overall sales total only. it will not sum with last value.

Thanks

sankar

• ###### 2. Re: Display the most recent data based on Days.

Good morning Sankar,

Unfortunately, I am aware of that . My question is how to do I obtain an accurate Total as well as display the most recent data for the days. Posb using a calculating field, as the grand total function usually doesn't work well with the Last() command - which is why I am seeking a calculating field to calculate the most recent days. I believe this would solve the Grand Total issue.

-Bill

• ###### 3. Re: Display the most recent data based on Days.

Hi Bill W

We can do it by windows Calculations.............

1) create a calculated field withe the following logic,

window_max(max[Date])

2)  Drag the above calculated field into Work Area, Then right click on

that, Then click on "Edit Table Calculations".

3) Then Define that Addressing , Partitions accordingly.

How to get the Latest Transaction date for each customer?

Best Regards

Laxman Kumar

1 of 1 people found this helpful
• ###### 4. Re: Display the most recent data based on Days.

Morning Laxman,

Thanks for the suggestion it worked, but I cant see any of the other dates :-/. It appears your method would only work with two dashboards. However, how would I display the appropriate Grand Totals?

-Bill

• ###### 5. Re: Display the most recent data based on Days.

Anyone else have any ideas?

-Bill