I am a bit new to Tableau.
I have two columns: DATE and Car Model
I want to create bar graphs for the Top 5 (Count of Car Model) each individual year on the same sheet.
When I select the Top N filter, it selects the overall top 5 models and displays counts for each such model.
However, each year has a different Top 5. I want to be able to get the top for that particular year only.
Can anyone help me with it?
This you can do through function INDEX
. Do these steps (I am replicating your problem on sample superstore as you haven't given any data)
I built a view/viz with order date
& customer name
rows shelf and sum(sales)
on columns shelf.
create a calculated field named say INDEX
with formula INDEX()
drag this INDEx
field to DETAILS
on Marks card
right click, edit table calculation
and set the following options -- specific dimensions (check both fields drag to adjust date field prior to second nested field) -- At the level (select second field name - customer name in my case) -- restarting at every (select first date field, order date in my case) -- sort order - CUSTOM - select Sales(Measure) with descending and aggregation as your measure (sum in my case). A screenshot is attached for reference
ctrl + drag INDEX field to Filter and select 1 to 5
.
Your desired view is ready
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.