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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Powerbing1
Frequent Visitor

How to create a slicer and measure with greater than or less than option

Hi

 

I am building a dashboard where I would like the user to select a value from the slicer and it will filter out on the number of products with that value, however I would like to also add in the option where the user could select less than or greater than.

 

Example

 

Below is the measure I am using :

 

Measure 1 =
SUMX (
'Product Table',
IF ('Product Table'[Stores Ranged]<SELECTEDVALUE(Number[Value],0),1,0))

 

i would like the user to be able to define based on their own preference if they would like <=SELECTEDVALUE(Number[Value],0),1,0) or >=SELECTEDVALUE(Number[Value],0),1,0)

 

How would i do this?

 

Thank you

1 REPLY 1
amitchandak
Super User
Super User

@Powerbing1 , You can create a what if parameter and have that

 

Try a measure like

 

var _max = maxx(allselected('Number'), 'Number'[Value])
var _min = minx(allselected('Number'), 'Number'[Value])
return
SUMX (
'Product Table',
IF ('Product Table'[Stores Ranged]<_max && [Stores Ranged]<_min,1,0))

 

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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