Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Andresan
Frequent Visitor

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. 
1 ACCEPTED SOLUTION

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+"

)

 

Untitled picture2.png

Best Regards,

Dedmon Dai

View solution in original post

10 REPLIES 10
Andresan
Frequent Visitor

Hey guys! @MFelix & @parry2k Thanks for jumping on this so quickly.

 

My goal is to use the slicer on the page level. I would like for it to filter other visuals as well.

 

My Days open column is as follows:

 

Days Open

Column.png

@Andresan not sure what you just pasted.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  That was the column pasted as a table format. I just changed it to a screenshot of the column. 

Here is the table format:

Days Open
3
17
17
17
17
17
17
17
14
13
12
7
5
4
79
7
7
6
2
29
29
29
29
29
29
29
 
 
 
 
15
 
29
29
4
0
29
29
29
29


Screenshot: 

 

Column.png

 

This is how I'd like the dropdown to look/work:

 

dropdown.png

@Andresan see attached pbix files. It will show data based on the selection in the slicer, if no selection is made then it will show everything.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k, Thanks for your help. What is it that makes the dropdown filter the table? I am having trouble getting it to work on my line chart visual. I am trying to understand the requirements that make it work. 

 

I tried to replicate everything you created to my example but couldn't get it to work.  My goal was to get to an aging visual report that displays the average open days by month. 

 

It's also filtering only the visuals that contain the measure and not the whole page. 

 

open by month.png

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+"

)

 

Untitled picture2.png

Best Regards,

Dedmon Dai

MFelix
Super User
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.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@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!!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k ,

 

Once again aswering at the same time. 😄

 

Completly agree with you, no doubt but without any background information just wanted to make @Andresan  think about one possible route.

 

This can also be used at page level filtering depending on the visualizations but again little information.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



parry2k
Super User
Super User

@Andresan how your raw data look like? Paste sample data in a table format and expected output.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.