Forum Discussion

Periksson's avatar
Periksson
Frequent Visitor
6 years ago

DYNAMIC TOP N SLICERS DISCUSSION

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:

Top N =
VAR SelectedTop = SELECTEDVALUE('Top N'[Top N])
RETURN
SWITCH(TRUE();
SelectedTop = 0; [Measure];
RANKX( ALLSELECTED( Units[Units] );
[Measure]
)
<= SelectedTop;
[Measure])

And it's really not working for me as it should.

I've tried this one too: https://powerbi.tips/2018/02/crazy-table-gymnastics-part-2-build-support-materials/
and part 1 of this tutorial, and it doesn't work for me at all. Please if you have any info chime in.

3 Replies