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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
KaySunset
Helper II
Helper II

Dynamic slicer values

Hi everyone,

 

I am looking for a solution to dynamically enter "from -> to" - values to filter a table. 

In the following screenshot, you can see a very simplified version of what I already got and where it should be going.

The "Cluster" Slicer is using a SWITCH statement to filter the table on the right side in terms of "#OrdersPerCust" (see statement below screenshot).

But instead of the fixed values (<= 1, <=2, etc.) I would like to have it dynamically. I drew a box highlighted with a green error (does not have to look exactly like that) to show what I mean: The empty boxes below "Slicer value from" and "Slicer value to" should allow me to enter e.g. 5 and 10 and then filter the table for all CustomerNames with #Orders between 5 and 10 (here: only Customer D).

Is there any way to make this possible? I have a sample PBIX attached, feel free to play around 🙂

 

Sample PBIX 

KaySunset_0-1704291319924.png

 

Cluster = CALCULATE ( IF( SUM(Customer[#OrdersPerCust]) = 0 , "0" ,
                                                IF( SUM(Customer[#OrdersPerCust]) <= 1 , "<= 1" ,
                                                IF( SUM(Customer[#OrdersPerCust]) <= 2 , "<= 2" ,
                                                IF( SUM(Customer[#OrdersPerCust]) <= 5 , "<= 5"
                                                , "> 5")))))
 
 

BR,

Kathrin

1 ACCEPTED SOLUTION

I found out the solution, see the file attached.

I had to change the datatype of #OrdersPerCust to fixed decimal number and modify the expression to generate a parameter to make sure it doesn't go over two decimal values. 

PBIX_DynamicSlicerValues3.pbix




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

5 REPLIES 5
KaySunset
Helper II
Helper II

Hi @Kaviraj11 ,

that's a great solution for my sample case, many thanks! I will mark it as solution later, but is there any chance you could further assist - unfortunately, I simplified my sample case a little too much 😄 

In my real example, I am trying to filter for decimal values. I have changed the sample file in this regard and cannot get it to work. It seems to be an issue with the relationship on the decimal columns, I feel like it might be an issue with the digits after the comma. I did, however, change format to 2 digits for all columns, and I did round for those measures/columns that I could. 

The slicer still does not work properly, when I try to filter everything between 1 and 2 there should be CustomerName "E" left, but it filters out everything. 

 

Any ideas? 🙂

New sample file is here: PBIX 

 

KaySunset_0-1704357132122.png

 

I found out the solution, see the file attached.

I had to change the datatype of #OrdersPerCust to fixed decimal number and modify the expression to generate a parameter to make sure it doesn't go over two decimal values. 

PBIX_DynamicSlicerValues3.pbix




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





That works well, many thanks 🙂

Kaviraj11
Solution Sage
Solution Sage

Also, you can change the measure as below to make sure it doesn't display the rest

CALCULATE(SUM(Customer[#OrdersPerCust]),FILTER(Customer,SUM(Customer[#OrdersPerCust])+0>=SELECTEDVALUE(Parameter[Parameter])))
 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Kaviraj11
Solution Sage
Solution Sage

 

Please find attached file with the solutions. 

https://1drv.ms/u/s!AokEm8Ze5L-ogYZ9zZ8u9EetJ9qR9w?e=6VWJ0l 

 

I have created a parameter, make sure the relationship is created, utilize it in slicer and in the measures created.

 

Please accept the solution, if it works for you.

 

Cheers




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.