Create one bar graph where I want to plot top 5 and bottom 5 profit product?

Hi Team,
I need you help for building the visualizations like I want to build a visual where it can plot the top 5 and bottom 5 profit product.
Also it is not hard coded lets the end-user select10 as a parameter then it is showing us top 10 and bottom 10 profit product.

You can do a top and bottom filter with an or statement.

Top 5 OR Bottom 5.

You would then just need to click on Use parameters and reference that parameter for your top x or bottom x.


Thanks Max but I need the same thing by using calculated field is there any way to build this visual by using calculated field.

You can use rank.

I would make two rank calculations. One sorting ASC and the other sorting DSC.

And then make an ifelse statement:

ifelse({rank_field_ASC}<5 OR {rank_field_DSC}<5,{value_field},NULL)