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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mjmmet
Frequent Visitor

use a "between" slicer to show records that have a total within the selected range

I have a matrix table of individuals showing donations given annually with a grand total for each individual. The data in the table shows the individual in rows and each year in columns. 

 

I would like have a "between" slicer to show records where the grand total falls into the selected range.  For example, if the slicer range is $5000-$10000, I would like the table to be filtered to only show individuals whose total giving is between $5000-$10000.

 

Is it possible to accomplish this using a slicer?

1 ACCEPTED SOLUTION

See if this works. 

Create a table to use as the slicer with the "New Parameter" option under Modeling in the ribbon. Enter the range of values:

What if.jpg

Once the slicer is added to the page, change the input to "Between" in the slicer's dropdown options

Inked2022-03-30_LI.jpg

I have the model set up like this. I will use the fields from the dimension tables in the matrix and the measure need to filter the matrix 

model.jpg

 

The values in the Matrix are a simple SUM measure. To filter the rows based on the range in the slicer, create the following measure:

 

 

Filter by Range =
VAR MinSelected =
    MIN ( 'Range of donations'[Range of donations] )
VAR MaxSelected =
    MAX ( 'Range of donations'[Range of donations] )
RETURN
    COUNTROWS (
        CALCULATETABLE (
            VALUES ( 'Name Table'[Name] ),
            FILTER (
                'Name Table',
                [Sum Donations] >= MinSelected
                    && [Sum Donations] <= MaxSelected
            )
        )
    )

 

 

Select the matrix and add this [Filter by Range] measure to the filter pane. Set the value to = 1

filter pane.jpg

 and you get

donations.gif

 

I've attached the sample PBIX file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
PaulDBrown
Community Champion
Community Champion

Is that the actual structure of your data? Do you need the slicer to be dynamic (users can select a range of values from say 100 to 10,000) or just the two ranges you posted?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






not the actual structure.. the individual gifts are summed up in the table by year.  I could use a  data source that has the annual gifts already calculated in a field if needed.  I want the slicer to allow any range to be selected and the data filter accordingly. 

So you have a table with 3 columns: Name, year and donation?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






sure, go with that.  thanks so much for your help!

PaulDBrown
Community Champion
Community Champion

Sure. Any chance you can post some sample mock data to work on?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Name201720182019202020212022Total
Joe500 300   800
Jack100010003000 1500 6500
Sam   50 50100
Bob    5000 5000
Bill 5050100100 300
Mike   2500 5003000
Susan 10001000 100030006000
Stephanie 4005050100100700

rows in blue would show when the selected slicer range is $500-$1,000

rows in cyan would show when the selected slicer range is $5,000 - $10,000

See if this works. 

Create a table to use as the slicer with the "New Parameter" option under Modeling in the ribbon. Enter the range of values:

What if.jpg

Once the slicer is added to the page, change the input to "Between" in the slicer's dropdown options

Inked2022-03-30_LI.jpg

I have the model set up like this. I will use the fields from the dimension tables in the matrix and the measure need to filter the matrix 

model.jpg

 

The values in the Matrix are a simple SUM measure. To filter the rows based on the range in the slicer, create the following measure:

 

 

Filter by Range =
VAR MinSelected =
    MIN ( 'Range of donations'[Range of donations] )
VAR MaxSelected =
    MAX ( 'Range of donations'[Range of donations] )
RETURN
    COUNTROWS (
        CALCULATETABLE (
            VALUES ( 'Name Table'[Name] ),
            FILTER (
                'Name Table',
                [Sum Donations] >= MinSelected
                    && [Sum Donations] <= MaxSelected
            )
        )
    )

 

 

Select the matrix and add this [Filter by Range] measure to the filter pane. Set the value to = 1

filter pane.jpg

 and you get

donations.gif

 

I've attached the sample PBIX file

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.