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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

how to filter by measure range

I have a simple sales data model.  I have a measure like Total Sales = SUM('Fact Sales'[Sale Amount]).  This measure appears as a Value on a matrix visual, where the dimension is 'Dimension Employee'[Employee Name].  I want to filter this matrix visual by pre-defined ranges of Total Sales that exist in a slicer.  So, I have created a disconnected table ('Total Sales Range Values') with my range options:

Total Sales Range

5,000+

1,000 - 4,999

0 - 999

 

How can I filter this matrix visual as described?  Note: If no slicer value is checked, then all rows should return in the matrix visual.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

If the range column is in text format, then you will need to create new columns for min value and max value in number format.

Such as below.

1.PNG

Then create a measure and add it to visual filter.

Measure = 
var _min = SELECTEDVALUE(slicer[min])
var _max = IF(ISBLANK(SELECTEDVALUE(slicer[max])),9999,SELECTEDVALUE(slicer[max]))
return
IF([totalsales]>=_min&&'Table'[totalsales]<=_max,1,0)

Result would be shown as below.

2.PNG

3.PNG

4.PNG

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

If the range column is in text format, then you will need to create new columns for min value and max value in number format.

Such as below.

1.PNG

Then create a measure and add it to visual filter.

Measure = 
var _min = SELECTEDVALUE(slicer[min])
var _max = IF(ISBLANK(SELECTEDVALUE(slicer[max])),9999,SELECTEDVALUE(slicer[max]))
return
IF([totalsales]>=_min&&'Table'[totalsales]<=_max,1,0)

Result would be shown as below.

2.PNG

3.PNG

4.PNG

 

Best Regards,

Jay

Tahreem24
Super User
Super User

Create a calculated column for sales range like below:

Range Column = Switch(Total Sales, Total Sales>0 && Total Sales <999, "0-999", Total Sales>1000 && Total Sales <4999, "1000-4999", Total Sales > 5000,"5000") 

 

And use this in slicer. 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

@Tahreem24 

 

Total Sales is a measure.  How can I use a measure in a calculated column?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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