Arpit Choudhary
Arpit Choudhary

Reputation: 11

I would like to display the whole graph as well as the latest highest and lowest points on the graph. How to do that in tableau?

For example: In sample superstore there are many days where lowest sales are 4. So I want to display only the point where there was a latest low of 4 and not all the 4's. If one value is repeated more than once then I want to display that value only for the latest date. One more example so that I a clear: lets take 3 dates-

**Order Date ** Sales

July 12, 2022 4

January 28, 2019 4

June 24, 2019 4

Now I want to display lowest. By default tableau will display July 12,2022 as the lowest. But now if I exclude July 12 then tableau next displays Jan 28,2019 which is completely wrong because after July 12,2022 the latest one should be June 24,2019. This is what I want to do. Displayed max and min value should be latest according to date and not ascending wise. I hope my question is clear.

I am not a pro but a beginner so I don't know anything except using measure in label and then selecting show max and min value. I expect that when there are multiple repetitive values then only that value should be selected which is against the latest date. If I exclude this value from the table then the next latest date should be selected. Example. If there is Jan Feb Mar all having same value then Mar should be displayed. If I exclude Mar then next Feb should be displayed and not Jan.

Upvotes: 1

Views: 84

Answers (1)

Tim Hart
Tim Hart

Reputation: 21

start by creating a custom calculation called Min or Max Sales which will display the Max or Min sales:

// Min or Max Sales:
IF  SUM([Sales]) = WINDOW_MIN(SUM([Sales])) OR
    SUM([Sales]) = WINDOW_MAX(SUM([Sales]))
THEN
     SUM([Sales])
END

Drop this next to your SUM(Sales), to produce two charts: enter image description here

Right-click on Min or Max Sales and select Dual Axis. enter image description here

Click to Synchronize the new axis: click to synchronize axis (Tip: if you want to hide this second axis, just uncheck "Show Header" from this same drop-down.)

Click on the marks card for the new axis and change the type from Default to Circle: change type to circle

You may want to bump up the size of the circle... increase circle size

...and drop the date and/or Min or Max Sales amount on the Text card to display it: Add date to text labels

Final product: result with text labels

I'm not quite following your concerns about displaying only the latest date when filtered. With this formula, if multiple days have the same minimum or maximum Sales volume, a dot will appear for each of those days. If you are having trouble with the order of your dates, right-click on your date dimension, select Sort and Descending.

Upvotes: 0

Related Questions