Forum Discussion
Slicer with custom dropdown
Hello,
I am looking to have a slicer dropdown with custom option values for an Aging visual. I have a column that already contains the days opened and I need to have the dropdown that shows:
0-30
31-45
46-60
61-90
90+
and filter based on those selections.
Hi Andresan ,
Based on the Mfelix's pbix file, If you reaaly want to apply the filter on the page-level filter, I suggest you use the calculated column for the slicer:
Column = SWITCH ( TRUE (), Sales[Days] >= 0 && Sales[Days] <= 30, "0-30", Sales[Days] >= 31 && Sales[Days] <= 45, "31-45", Sales[Days] >= 46 && Sales[Days] <= 65, "46-60", Sales[Days] >= 61 && Sales[Days] <= 90, "61-90", "90+" )Best Regards,
Dedmon Dai
10 Replies
- MFelix
Super User
Hi Andresan ,
Believe you need to create a table with the following format:
ID Range Min Max 1 0-30 0 30 2 31-45 31 45 3 46-60 46 60 4 61-90 61 90 5 +90 90 100000 Now you need to add a measure similar to this:
FIltering By days = IF(selectedvalue(Table[Days]) <= Max(Table[Max]) &&selectedvalue(Table[Days]) >= MIN(Table[MIN]); 1 ; 0)Now just filter your visualization or report by the value 1 and use the range column as your slicer.
- parry2k
Super User
MFelix this will work but only my concern is that every visual where this data needs to be filtered, one has to use the visual level filter. Again, no doubt it will work, I would rather have it in measure so that measure takes cares of it. Nothing right or wrong here, just my thought process. Cheers!!
- MFelix
Super User
- AndresanFrequent Visitor