The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I want to create a new slicer that can filter my data using a slider. I've managed to create a slicer like that using the new parameters, but i want to use my own data and not create a new range.
How can I do this?
Any help would be much appreciated!
Thanks in advance
Solved! Go to Solution.
Hi @Nathan_M_ ,
To create a slicer in Power BI that filters data using a single-value slider without defining a min-max range, you need to create a disconnected table with unique values from your numeric column. Instead of using a parameter, you can generate this table using DAX:
Number_Slider = DISTINCT(SELECTCOLUMNS('YourTable', "Value", 'YourTable'[YourNumberColumn]))
This table will contain distinct values from your data column and will serve as the source for the slicer. Since it is disconnected from the main table, selecting a value will not automatically filter the data.
Next, create a measure that will allow filtering based on the selected value from the slicer:
Selected_Value_Filter =
VAR SelectedValue = SELECTEDVALUE(Number_Slider[Value])
RETURN IF(SELECTEDVALUE('YourTable'[YourNumberColumn]) = SelectedValue, 1, 0)
This measure checks if the selected number from the slider matches the values in the main table and returns 1 for matching rows.
Now, add Number_Slider[Value] to a slicer and set it as a slider. Since this table is disconnected, you need to manually apply the filter to your visuals. Open the Visual Filters pane for the table or chart you want to filter, add Selected_Value_Filter, and set it to 1. This ensures that only rows where the selected number matches the column value will be displayed.
By following this approach, you can achieve a single-value slider that filters your data dynamically without using predefined min-max ranges. Let me know if you need further refinements!
Best regards,
Hi @Nathan_M_
I am assuming you want to be able to select a single value only. If so, you will need to use Tabular Editor to modify the column's Extended Property
Use the following properties:
Name: ParameterMetadata
Value: {"version":0}
Hi @Nathan_M_ ,
To create a slicer in Power BI that filters data using a single-value slider without defining a min-max range, you need to create a disconnected table with unique values from your numeric column. Instead of using a parameter, you can generate this table using DAX:
Number_Slider = DISTINCT(SELECTCOLUMNS('YourTable', "Value", 'YourTable'[YourNumberColumn]))
This table will contain distinct values from your data column and will serve as the source for the slicer. Since it is disconnected from the main table, selecting a value will not automatically filter the data.
Next, create a measure that will allow filtering based on the selected value from the slicer:
Selected_Value_Filter =
VAR SelectedValue = SELECTEDVALUE(Number_Slider[Value])
RETURN IF(SELECTEDVALUE('YourTable'[YourNumberColumn]) = SelectedValue, 1, 0)
This measure checks if the selected number from the slider matches the values in the main table and returns 1 for matching rows.
Now, add Number_Slider[Value] to a slicer and set it as a slider. Since this table is disconnected, you need to manually apply the filter to your visuals. Open the Visual Filters pane for the table or chart you want to filter, add Selected_Value_Filter, and set it to 1. This ensures that only rows where the selected number matches the column value will be displayed.
By following this approach, you can achieve a single-value slider that filters your data dynamically without using predefined min-max ranges. Let me know if you need further refinements!
Best regards,