简体   繁体   中英

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.

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: 在此处输入图像描述

Right-click on Min or Max Sales and select Dual Axis. 在此处输入图像描述

Click to Synchronize the new 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: 将类型更改为圆形

You may want to bump up the size of the circle... 增加圆圈大小

...and drop the date and/or Min or Max Sales amount on the Text card to display it: 将日期添加到文本标签

Final product: 带有文本标签的结果

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM