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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mpicca13
Resolver IV
Resolver IV

Add/Remove Bins in Bar Chart based on Slicer Selection

I have a bar chart that calculates percentages of negative reviews and groups them in increment ranges of 10%.

so 5 bins in total in the visual (10-20%, 20-30%, 30-40%, 40-50%, >50%)

 

There is also a slicer on the page called Threshold in which if if the user chooses a single selection starting from 10%. and has the option to choose, [20%, 30%, 40%, 50%]

 

Based on the threshold selection, bins the bar chart will be added or removed.

So if 10% is selected, any bin >= 10% is shown (Which would be all bins).

 

if 30% is selected, then the only bins shown would be [30-40%, 40-50%, >50%]

 

How can I go about Dynamically removing bins based on the users selection?

Creating relationship between thresholds table and Bin table will remove all bins with the exception of one (The one with 

the linked relationship)

 

see images below:

 

Chart with slicer

Capture.PNG

 

Table showing Bin values

Capture2.PNG

 

Threshold table used for slicer

Capture3.PNG

 

Intended Result

Capture4.PNG

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mpicca13 , Assume You are already using a measure (called as a measure or use the calculation in use in values of visual)

Have a new measure  like

 

new measure =
var _max = maxx(allselected(Threshold),Threshold[Threshold])
return
if(max('High Negative'[Max]) >_max , [Measure], blank())

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@mpicca13 , Assume You are already using a measure (called as a measure or use the calculation in use in values of visual)

Have a new measure  like

 

new measure =
var _max = maxx(allselected(Threshold),Threshold[Threshold])
return
if(max('High Negative'[Max]) >_max , [Measure], blank())

Hi @amitchandak ,

I have a similar question where I need to filter the bins based on a numeric slicer. For example, if I want to show the bins whose values are greater than 40 only those bins must be visible.

HIMANSHU_SINGH_1-1644566194434.png


Can you help me with this to achieve it?

 

Worked Like a charm, thanks @amitchandak 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.