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
Hi Everyone,
i have a table visual which has Account Name, current period revenue and previous period revenue as values.
I need to give 2 slicers .
1) to select Top/Bottom/All
2) to select number between 2 and 30
Now based on the slicer selections, my table visual should show change.
eg: if I choose All then it should show all Account Name.
if Top and 5 is selected, then table should show top 5 accounts with highest current period revenue. And similar for Bottom as well.
My current solution involves creating the below measure and adding it as Visual level filter :
Solved! Go to Solution.
Top/Bottom Account =
SWITCH (
SELECTEDVALUE ( 'Top/Bottom - Account'[Selection] ),
"All", 1,
"Top",
IF (
MAX ( 'Sales'[Account Name] )
IN CALCULATETABLE (
VALUES ( 'Sales'[Account Name] ),
TOPN (
SELECTEDVALUE ( 'Drop Down - Account'[Values] ),
ALLSELECTED ( 'Sales'[Account Name] ),
[Current Period Revenue], DESC
)
),
1
),
IF (
MAX ( 'Sales'[Account Name] )
IN CALCULATETABLE (
VALUES ( 'Sales'[Account Name] ),
TOPN (
SELECTEDVALUE ( 'Drop Down - Account'[Values] ),
ALLSELECTED ( 'Sales'[Account Name] ),
[Current Period Revenue], ASC
)
),
1
)
)
Top/Bottom Account =
SWITCH (
SELECTEDVALUE ( 'Top/Bottom - Account'[Selection] ),
"All", 1,
"Top",
IF (
MAX ( 'Sales'[Account Name] )
IN CALCULATETABLE (
VALUES ( 'Sales'[Account Name] ),
TOPN (
SELECTEDVALUE ( 'Drop Down - Account'[Values] ),
ALLSELECTED ( 'Sales'[Account Name] ),
[Current Period Revenue], DESC
)
),
1
),
IF (
MAX ( 'Sales'[Account Name] )
IN CALCULATETABLE (
VALUES ( 'Sales'[Account Name] ),
TOPN (
SELECTEDVALUE ( 'Drop Down - Account'[Values] ),
ALLSELECTED ( 'Sales'[Account Name] ),
[Current Period Revenue], ASC
)
),
1
)
)
Hi @Anonymous,
Perhaps you can take a look at the following link that also talked about dynamic top/bottom N if it helps for your requirement:
Solved: Dynamic Top/Bottom N Slicer - Almost have it! - Microsoft Power BI Community
Regards,
Xiaoxin Sheng
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 10 |