Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a table containing sales transactions including the Gross Margin % for each. I want to give users the ability to use a range slicer to filter out "normal" transactions where we made x% Gross Margin (eg: between 25% and 75%) and only display the transactions that fall outside that range (eg: anything below the low threshold (eg: 25%) and above the high threshold (eg: above 75%) highlighted below).
I want the users to be able to select the upper and lower limits for themselves between 1-100% using a range-slicer. Ideally the range would be in 5% increments and not litterally 1%-100% but I'm not sure I can do that with a range slicer?
Thanks in advance for any input.
G
Solved! Go to Solution.
Hi @gandalf1969 ,
Here are the steps you can follow:
1. New parameter – Numeric range.
Data type – Decimal number
Minium – 0.01
Maximum -- 1
Refer to:
Use parameters to visualize variables - Power BI | Microsoft Learn
Column tools -- %
Slicer settings – Style – Between.
2. Create measure.
Flag =
var _min=MINX(ALLSELECTED(Parameter),'Parameter'[Parameter])
var _max=MAXX(ALLSELECTED(Parameter),'Parameter'[Parameter])
return
IF(
[GM%]>=_min&&[GM%]<=_max,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @gandalf1969 ,
Here are the steps you can follow:
1. New parameter – Numeric range.
Data type – Decimal number
Minium – 0.01
Maximum -- 1
Refer to:
Use parameters to visualize variables - Power BI | Microsoft Learn
Column tools -- %
Slicer settings – Style – Between.
2. Create measure.
Flag =
var _min=MINX(ALLSELECTED(Parameter),'Parameter'[Parameter])
var _max=MAXX(ALLSELECTED(Parameter),'Parameter'[Parameter])
return
IF(
[GM%]>=_min&&[GM%]<=_max,1,0)
3. Place [Flag]in Filters, set is=1, apply filter.
4. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you for your ideas. The output is actually the opposite of what I am wanting to acheive BUT I can see how changing the Visual Filter to '0' does the trick. I can see how a simple measure on a disconnected table allows me to set the min/max. I'm not sure Parameters acheives more than just using a slicer in this instance (note your PBIX demonstrates the range is contiguous values regardless of your incremental parameters). I DO see how it lets you SET incremental values but as soon as I try to use a range slicer, it turns it into a contiguous range from min-to-max. So, I will accept this as the answer because it does inadvertantly answer my questions and I can build a solution.
Use a disconnected table of my incremental Min/Max values.
Use separate Min & Max dropdown slicers on the table to select the values.
Use a measure to create the filter based on those Min/Max values for in/out of range.
Apply that measure against the data table - using a visual filter to show only flag'd values of '0'.
It seems using a range slicer does not allow for incremental values.
Thank you,
G
You could use a disconnected range slicer and a "not" measure as your visual filter. Or you could use the filter pane which would allow you to specify two conditions, namely "Margin less than 25% OR Margin greater than 75%".
Thank you for your response. I'm looking for a solution that gives the user a control (slicer) on the page to dynamically filter the data (vs having them use the filter pane manually).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
145 | |
73 | |
63 | |
52 | |
51 |
User | Count |
---|---|
208 | |
91 | |
62 | |
59 | |
56 |