cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## (Top/Bottom) 5 Slicer

I recently used this article, to dynamically change information within a slicer. Pretty cool!

However, I was curious if there was any tutorial for a slicer to select either the top or the bottom 5 with a [Value].

I was thinking of using a RANKX function while somehow making the DESC or ASC variables.

Is this feasible with DAX?

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Visitor

## Re: (Top/Bottom) 5 Slicer

Hi Xioxin Sheng,

Thanks for the help!

I was able to figure it out here!

https://community.powerbi.com/t5/Data-Stories-Gallery/Executive-Insights-by-Decisive-Data/m-p/181742

Best,

Jake

5 REPLIES 5
Senior Member

## Re: (Top/Bottom) 5 Slicer

Community Support Team

## Re: (Top/Bottom) 5 Slicer

Hi @jolsby,

Yes, it is possible. For detailed information, you can refer to below steps:

1. Add a column to calculate the rank.

`Rank = RANKX(ALL('Table'),[Amount],,DESC,Skip)`

2. Calculate the top/bottom based on rank.

```Top/Bottom =
IF([Rank]<=5,"Bottom 5",if([Rank]>=MAX([Rank])-5,"Top 5","Other"))```

3. Use the Top/Bottom column as the source of slicer.

BTW, the visual level filter also contains topn function.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For learning resources/Release notes, please visit: | |
Regular Visitor

## Re: (Top/Bottom) 5 Slicer

Hi @v-shex-msft,

I am unable to work this solution unfortunately, as I am calculating on my [Value] on a Calculated Measure.

Error on performing measure.Using a parameter, within a new Measure causes no errors.RankTest MeasureIf I try to view the information as a column, I recieve the attached error.

For context, the measure's are essentially a continuation of these demo measures.

I looked into this, as a potential solution, but I wasn't seeing a proper output either.

Many thanks for your assistance Xiaoxin Sheng.

All my best,

Jolsby

Community Support Team

## Re: (Top/Bottom) 5 Slicer

Hi @jolsby,

All my formula are works on calculated column. Can you please share some sample data to test ?

For Velarde's solution, it seems like use measure to calculate rank, then use slicer to ensure the sort mode(ASC or DESC), finally use visual level filter to filter the rank range.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For learning resources/Release notes, please visit: | |
Regular Visitor

## Re: (Top/Bottom) 5 Slicer

Hi Xioxin Sheng,

Thanks for the help!

I was able to figure it out here!

https://community.powerbi.com/t5/Data-Stories-Gallery/Executive-Insights-by-Decisive-Data/m-p/181742

Best,

Jake