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
Anonymous
Not applicable

Dropdown menu for a slicer

Hello!

 

I'm trying to figure out how can i make a dropdown menu for my slicer that will show a range for my numbers for example 7000-8000 and after clicking it will show all of the numbers that are between that criterion.

 

I have numbers from 4000 to 11000I have numbers from 4000 to 11000

1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

Hello @Anonymous ,

 

Create a new calculated column (not measure) with number groups (ranges). Use the formula below. Then add it in a slicer

 

 

Group Values=
SWITCH (
    TRUE (),
    Table1[column X] >= 0
        && Table1[column X] < 7000, "0-7000",
    Table1[column X] >= 7000
        && Table1[column X] <= 8000, "7000-8000",
    "other"
)

 

 

View solution in original post

4 REPLIES 4
themistoklis
Community Champion
Community Champion

Hello @Anonymous ,

 

Create a new calculated column (not measure) with number groups (ranges). Use the formula below. Then add it in a slicer

 

 

Group Values=
SWITCH (
    TRUE (),
    Table1[column X] >= 0
        && Table1[column X] < 7000, "0-7000",
    Table1[column X] >= 7000
        && Table1[column X] <= 8000, "7000-8000",
    "other"
)

 

 

Anonymous
Not applicable

@themistoklis

 

I right clicked my table and selected "New column" and used the code that you made.

I'm getting an error "Unexpected expression" in few spots in the code.

 

This is your codeThis is your codeI added a semicolon behind TRUE(); and "0-7000" and "7000-8000"; and it still complaining.I added a semicolon behind TRUE(); and "0-7000" and "7000-8000"; and it still complaining.

 

 

 

maybe it has to do with your regional settings... instead of comma (,) use semicolon (;) in the formula

 

on the second image you have commas in couple of places (before the number range)

Anonymous
Not applicable

Thank you, it works now.

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.