Forum Discussion
DYNAMIC TOP N SLICERS DISCUSSION
Can you please provide more details on what you need. Not clear with your formula.
If you lloking for dynamic slicer refer:https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115
Hi amitchandak, thanks for your response. I'm searching for a Top N filter slicer that works. Let me give you an example:
I want to slice products based on margin for example. From the measure I somewhat provided it would look like this:
Top N products based on margin =
VAR SelectedTop = SELECTEDVALUE('Top N'[Top N])
RETURN
SWITCH(TRUE();
SelectedTop = 0; [Margin];
RANKX( ALLSELECTED( Products[Products] );
[Margin]
)
<= SelectedTop;
[Margin])
So, when I want to expand this in my visualizations with another field from my table (for example, year), the filtering breaks and it won't filter anymore. I know that the measure depends on the ALLSELECTED() part (when I put ALL instead of ALLSELECTED it somewhat works but the filtering is very very slow then because it goes through all my records in the table).
- amitchandak6 years agoSuper User
Refer these, if they can help
https://www.fourmoo.com/2018/02/06/dax-power-bi-dynamic-topn-made-easy-with-what-if-parameter/