Forum Discussion
TopN +Others use toolhint
- 1 year ago
Thank you for quick provide solution.
I just find the other way is what i looking for .
https://www.sqlbi.com/articles/filtering-the-top-products-alongside-the-other-products-in-power-bi/
Hi,
I tried to create a sample pbix file like below, and please check the below picture and the attached pbix file.
I tried to use WINDOW DAX function to generate TOPN values.
WINDOW function (DAX) - DAX | Microsoft Learn
WINDOW function (DAX) - DAX | Microsoft Learn
Case Top N: =
VAR _topN = 'TopN'[TopN Value]
VAR _t =
WINDOW (
1,
ABS,
_topN,
ABS,
ALL ( serverity[serverity], serverity[sort] ),
ORDERBY ( [Case:], DESC )
)
VAR _others =
CALCULATE ( [Case:], ALL ( serverity[serverity], serverity[sort] ) )
- CALCULATE ( [Case:], _t )
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( serverity[serverity] ) = "Others", _others,
HASONEVALUE ( serverity[serverity] ), CALCULATE ( [Case:], KEEPFILTERS ( _t ) ),
[Case:]
)
- MichelleTW7291 year agoHelper I
Thank you for quick provide solution.
I just find the other way is what i looking for .
https://www.sqlbi.com/articles/filtering-the-top-products-alongside-the-other-products-in-power-bi/
- Anonymous1 year agoNot applicable
Hi MichelleTW729 ,
Glad to hear you have found a solution! If the issue has been resolved, please mark your post as answer. That way, others with similar issues can more easily find a solution .If you have any questions, feel free to reach out !
Thank you.