Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I Have four columns that I want to filter between, Min X, Max X, Min Y, Max Y. I would like to have a filter which has a numeric (text box) input where I can input a number and it then shows only the rows that where the number is between the MIN and MAX.
To further explain what I would like would be a two text boxes (one for X and one for Y) the maths behind it should be:
MinX<=InputX<=MaxX
MinY<=InputY<=MaxY
But the problem with this is that I don't know how to do that, I don't know if I will have to make a new measure and what to put in that measure.
Bellow is an example of the table that I have and what an input would be an the expected output.
Box Name | Min X | Max X | Min Y | Max Y |
A1 | 2.2000 | 2.4000 | 1.3500 | 1.7000 |
A2 | 2.2000 | 2.4000 | 1.3500 | 1.7000 |
A3 | 2.5000 | 2.5500 | 1.8500 | 1.9000 |
A4 | 2.5000 | 2.5500 | 1.8500 | 1.9000 |
A5 | 1.6000 | 2.5000 | 1.0700 | 1.9000 |
A6 | 1.4800 | 1.6700 | 0.8900 | 1.1000 |
A7 | 2.1400 | 2.8500 | 1.3200 | 1.7000 |
If my input is:
X=2.3
Y=1.4
A1, A2, A5, A7 should all stay on the page but this does not happen when I use a between slicer.
Bellow is a page that is similar to what I have tried. i have four slicers that a all between as you cant have a between slicer that works for two columns but this system does not at all.
When I tell the X MIN slicer that its min should be 2.3 and the X MAX slicer 2.3 I get the wrong out put completely even though it should output A1, A2, A5, A7 and more.
I cant just put the inputs to be the same as the values in the table as it will show wrong information along with correct information.
I can provide more information if needed but I only work on two days a week
Solved! Go to Solution.
This can be done with parameters and dax.
first create two parameters. I've recreated your example table. I named my parameters
I did modify the DAX so that it would not filter everything out if i had blank values for some bits of the table
Hi @Aidan12345
Create a numeric range parameter from the modelling tab. The GUI will not allow you to use decimals but you can adjust the formula later. Do this twice - one for x and one for y.
Then create this measure and use it is a visual filter
Filter2 =
VAR _InputX = [XMax Value] -- Assuming you have a measure or parameter for InputX
VAR _InputY = [YMax Value] -- Assuming you have a measure or parameter for InputY
RETURN
CALCULATE(
COUNTROWS('Table'),
KEEPFILTERS(
'Table'[Min X] <= _InputX && _InputX <= 'Table'[Max X] &&
'Table'[Min Y] <= _InputY && _InputY <= 'Table'[Max Y]
)
)
Please see the attached sample pbix.
This can be done with parameters and dax.
first create two parameters. I've recreated your example table. I named my parameters
I did modify the DAX so that it would not filter everything out if i had blank values for some bits of the table
@Aidan12345 , Try using What if parameter
Go to the Modeling tab and select "New Parameter" -> "What If Parameter".
Create a parameter for X with a range that covers your Min X and Max X values.
Create a parameter for Y with a range that covers your Min Y and Max Y values.
Proud to be a Super User! |
|
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
39 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |