Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I was trying to do "Top N + others", tried many options from different community and finaly only one solution worked for me from below link,
https://www.goodly.co.in/top-n-and-others-power-bi/
Now problem is total is not considering "Others" - it should be 29M instead of 4M.
Can anyone suggest how to fix this "Total"..
Here is the DAX used ,
attached two solutions PBIX files I used here,
https://we.tl/t-xIzgNWAzme
Thanks in advacne
Solved! Go to Solution.
This is because your CurrentProd is blank for the Total case (since multiple Products are in scope).
Try updating the RETURN part of your DAX to this:
RETURN
IF(
ISBLANK ( CurrentProd ),
TopProdSales + OtherSales,
IF (
CurrentProd <> "Others",
TopProdSales,
OtherSales
)
)
Hmm. Maybe the bottom products don't have any sales, so they're returning blank.
This is because your CurrentProd is blank for the Total case (since multiple Products are in scope).
Try updating the RETURN part of your DAX to this:
RETURN
IF(
ISBLANK ( CurrentProd ),
TopProdSales + OtherSales,
IF (
CurrentProd <> "Others",
TopProdSales,
OtherSales
)
)
Thank you so much @AlexisOlson , it is adding up now.
Any option to do the same for "Bottom" N instead of "Top" for the same table - couldn't find a solution
You can use the opposite sorting in the TOPN function. That is, use ASC rather than the default DESC.
Tried it but getting only "Others" total.
Top N Sum Sales v2 =
VAR TopNSelected = SELECTEDVALUE('TopN Selection'[Value])
VAR TopProdTable =
TOPN(
TopNSelected,
ALLSELECTED('Pseudo Prod Table'),
[Total Sales],ASC
)
VAR TopProdSales =
CALCULATE(
[Total Sales],
KEEPFILTERS( TopProdTable )
)
VAR OtherSales =
CALCULATE(
[Total Sales],
ALLSELECTED('Pseudo Prod Table')
) -
CALCULATE(
[Total Sales],
TopProdTable
)
VAR CurrentProd = SELECTEDVALUE('Pseudo Prod Table'[Product])
RETURN
IF(
ISBLANK ( CurrentProd ),
TopProdSales + OtherSales,
IF (
CurrentProd <> "Others",
TopProdSales,
OtherSales
)
)
here is the output
Hmm. Maybe the bottom products don't have any sales, so they're returning blank.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |