Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jolsby
Advocate IV
Advocate IV

(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

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

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

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.

Capture.PNG

 

BTW, the visual level filter also contains topn function.

 

Regards,

Xiaoxin Sheng

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

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.Error on performing measure.Using a parameter, within a new Measure causes no errors.Using a parameter, within a new Measure causes no errors.RankTest MeasureRankTest MeasureIf I try to view the information as a column, I recieve the attached error.If 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

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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

Anonymous
Not applicable

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.