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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Gaurav_84
Helper I
Helper I

custom filter/Slicer

Hi Experts,

 

I am looking to create custom Filter/slicer. Right now i am using standard filter but i unable to select data in range. Eeverytime i have to click control button in order to select multiple selections. I need to create slicer/Filter where i can give range for example A/00001 to A/99999 or T/00001 to T/99999 

Gaurav_84_0-1628482757981.png

I am looking something like below slicer instead of date i can use above code.

Gaurav_84_1-1628483063981.png

 

 

Regards

Gaurav

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Gaurav_84 

it looks impossible in Desktop, currently filter does not support range selection for text type values, but you can take this workaround.

-

create the 2 columns

Left = LEFT('Table'[Code],1)
Right = RIGHT('Table'[Code],6)

vxiaotang_0-1629189353558.png

vxiaotang_1-1629189383486.png

result

vxiaotang_2-1629189394824.png


Best Regards,
Community Support Team _Tang

View solution in original post

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @Gaurav_84 

it looks impossible in Desktop, currently filter does not support range selection for text type values, but you can take this workaround.

-

create the 2 columns

Left = LEFT('Table'[Code],1)
Right = RIGHT('Table'[Code],6)

vxiaotang_0-1629189353558.png

vxiaotang_1-1629189383486.png

result

vxiaotang_2-1629189394824.png


Best Regards,
Community Support Team _Tang

Jos_Woolley
Solution Sage
Solution Sage

Hi,

You could have two slicers, one for the lower limit and one for the upper limit.

Create 2 new tables:

 

Lower Code =
SELECTCOLUMNS ( 'Table', "Lower Code", 'Table'[Code] )
Upper Code =
SELECTCOLUMNS ( 'Table', "Upper Code", 'Table'[Code] )

 

Then 2 new measures:

 

InCodeRange =
SUMX (
    'Table',
    0
        + (
            'Table'[Code] >= SELECTEDVALUE ( 'Lower Code'[Lower Code] )
                && 'Table'[Code] <= SELECTEDVALUE ( 'Upper Code'[Upper Code] )
        )
)
UpperCodeFilter =
SUMX (
    'Upper Code',
    0
        + ( 'Upper Code'[Upper Code] >= SELECTEDVALUE ( 'Lower Code'[Lower Code] ) )
)

 

Add two slicer visuals to your page, one referencing the Lower Code field and the other the Upper Code field.

Highlight the Upper Code slicer and, in the Filter pane, drag in the UpperCodeFilter measure and set the condition as 'is 1'.

Highlight the visual you wish to filter (or add as a page filter, as per your requirements) and, in the Filter pane, drag in the InCodeRange measure and set the condition as 'is 1'.

Regards

TomMartens
Super User
Super User

Hey @Gaurav_84 ,

 

unfortunately, this is not possible.

Currently, only columns with a date, datetime, or numerical datatype are able to leverage the range (between) slicer type.

You have to create an idea on ideas.powerbi.com to get this option enabled for text columns.

 

To overcome this limitation, you might consider adding two additional columns to the table that contains the column code, one that stores the text part and the other one stores the number, meaning 1 instead of 000001. Then you can use these new columns for the filtering and you can also use the between option for the number column.

 

Hopefully, this provides some ideas on how to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
amitchandak
Super User
Super User

@Gaurav_84 , as of now range slicer is possible for Number or date only

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors