Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello folks,
Can someone please point me in the right direction for implementing a dynamic slicer based on a measure? I've seen many solutions on the internet, but there is always something at fault with them, some visualizations don't work with the slicer or something. Or at least if someone has a walkthrough on do's and dont's on how to implement dynamic top n slicers it would be very much appreciated.
One of the most frequent I've seen is something like this:
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/50...
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).
Refer these, if they can help
https://www.fourmoo.com/2018/02/06/dax-power-bi-dynamic-topn-made-easy-with-what-if-parameter/
https://www.youtube.com/watch?v=QtEt-QI3oe4
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |