Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello
I have the data below:
| Col1 | Col2 | Col3 |
| A | 1 | 100 |
| A | 2 | 101 |
| B | 3 | 102 |
| B | 4 | 103 |
| B | 5 | 104 |
I would like to a create custom slicer that will have a tickbox named 'Top 3' and when you click that, it will filter to the largest three records based on Col2 and a tickbox named 'Bottom 3' to select the smallest (complying with any additional filters of course).
How can I do that?
Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) We can create a table.
tickbox = {"Top3","Buttom3"}
(2) We can create a measure.
Flag =
var _selectedvalue=SELECTEDVALUE(tickbox[Value])
var _topn=SELECTCOLUMNS(TOPN(3,ALLSELECTED('Table'),'Table'[Col2],ASC),"1",'Table'[Col3])
var _buttom=SELECTCOLUMNS(TOPN(3,ALLSELECTED('Table'),'Table'[Col2],DESC),"1",'Table'[Col3])
return
SWITCH( _selectedvalue,
"Top3",IF(MAX('Table'[Col3]) in _topn,1,0),
"Button3",IF(MAX('Table'[Col3]) in _buttom,1,0),
1)
(3) As shown in the following image, set up filtering on visuals and then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) We can create a table.
tickbox = {"Top3","Buttom3"}
(2) We can create a measure.
Flag =
var _selectedvalue=SELECTEDVALUE(tickbox[Value])
var _topn=SELECTCOLUMNS(TOPN(3,ALLSELECTED('Table'),'Table'[Col2],ASC),"1",'Table'[Col3])
var _buttom=SELECTCOLUMNS(TOPN(3,ALLSELECTED('Table'),'Table'[Col2],DESC),"1",'Table'[Col3])
return
SWITCH( _selectedvalue,
"Top3",IF(MAX('Table'[Col3]) in _topn,1,0),
"Button3",IF(MAX('Table'[Col3]) in _buttom,1,0),
1)
(3) As shown in the following image, set up filtering on visuals and then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 68 | |
| 46 | |
| 44 | |
| 29 | |
| 20 |
| User | Count |
|---|---|
| 202 | |
| 130 | |
| 102 | |
| 71 | |
| 55 |