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
Top N Qty =
VAR TopNSelected = SELECTEDVALUE('TopN'[TopN])
VAR TopQtyTable =
TOPN(
TopNSelected,
ALLSELECTED('PseudoBrand Table'),
[FloorShareTotal]
)
VAR TopQty =
CALCULATE(
[FloorShareTotal],
KEEPFILTERS( TopQtyTable)
)
VAR OthersQty =
CALCULATE(
[FloorShareTotal],
ALLSELECTED('PseudoBrand Table')
) -
CALCULATE(
[FloorShareTotal],
TopQtyTable
)
VAR CurrentBrand = SELECTEDVALUE('PseudoBrand Table'[Brand])
RETURN
IF(
CurrentBrand <> "Others",
TopQty,
OthersQty
)So if I take the Top N Qty measure and use it as my Y-axis in a bar chart, and the Brand from PseudoBrand Table as my X-axis. I can use the TopN slicer to let's say filter to Top 3 then the bar chart will only show me the Top 3 brands and the rest of the brands will be under Others.
Please help me understand how all of these works, especially the variables.
Thank you!
Solved! Go to Solution.
Hi @RingoSun
Thanks for reaching out to us.
Please see this article, TOPN function (DAX) - DAX | Microsoft Docs
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @RingoSun
Thanks for reaching out to us.
Please see this article, TOPN function (DAX) - DAX | Microsoft Docs
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
@RingoSun
I would suggest the following video from sqlbi.com : https://youtu.be/nVvlEHKr_0o
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |